
// this is autogenerated file, do not edit it.
#include "ficus/ficus.h"

struct _fx_Nt6option1N10Ast__typ_t_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst);

struct _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t;

static void _fx_free_Nt9Dynvec__t1N15K_form__kinfo_t(struct _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t** dst);

struct _fx_Nt6option1N10Ast__exp_t_data_t;

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst);

struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t;

static void _fx_free_Nt10Hashset__t1R9Ast__id_t(struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t** dst);

struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t;

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst);

struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t;

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst);

struct _fx_N10Ast__typ_t_data_t;

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst);

struct _fx_N13Ast__binary_t_data_t;

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst);

struct _fx_N10Ast__exp_t_data_t;

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst);

struct _fx_N10Ast__pat_t_data_t;

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst);

struct _fx_N16Ast__env_entry_t_data_t;

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst);

struct _fx_N16Ast__defmodule_t_data_t;

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst);

struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t;

static void _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** dst);

struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t;

static void _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t** dst);

struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t;

static void _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** dst);

struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t;

static void _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t** dst);

struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t;

static void _fx_free_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t** dst);

struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t;

static void _fx_free_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t** dst);

struct _fx_N14K_form__ktyp_t_data_t;

static void _fx_free_N14K_form__ktyp_t(struct _fx_N14K_form__ktyp_t_data_t** dst);

struct _fx_N14K_form__kexp_t_data_t;

static void _fx_free_N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t** dst);

typedef struct _fx_Nt6option1N10Ast__typ_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__typ_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__typ_t_data_t, *_fx_Nt6option1N10Ast__typ_t;

typedef struct _fx_LS_data_t {
   int_ rc;
   struct _fx_LS_data_t* tl;
   fx_str_t hd;
} _fx_LS_data_t, *_fx_LS;

typedef struct _fx_Ta2i {
   int_ t0;
   int_ t1;
} _fx_Ta2i;

typedef struct _fx_T2Ta2iS {
   struct _fx_Ta2i t0;
   fx_str_t t1;
} _fx_T2Ta2iS;

typedef struct _fx_R9Ast__id_t {
   int_ m;
   int_ i;
   int_ j;
} _fx_R9Ast__id_t;

typedef struct _fx_R10Ast__loc_t {
   int_ m_idx;
   int_ line0;
   int_ col0;
   int_ line1;
   int_ col1;
} _fx_R10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_ti {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
} _fx_T2R9Ast__id_ti;

typedef struct _fx_T2Bi {
   bool t0;
   int_ t1;
} _fx_T2Bi;

typedef struct _fx_N12Ast__scope_t {
   int tag;
   union {
      int_ ScBlock;
      struct _fx_T2Bi ScLoop;
      int_ ScFold;
      int_ ScArrMap;
      int_ ScMap;
      int_ ScTry;
      struct _fx_R9Ast__id_t ScFun;
      struct _fx_R9Ast__id_t ScClass;
      struct _fx_R9Ast__id_t ScInterface;
      int_ ScModule;
   } u;
} _fx_N12Ast__scope_t;

typedef struct _fx_LN12Ast__scope_t_data_t {
   int_ rc;
   struct _fx_LN12Ast__scope_t_data_t* tl;
   struct _fx_N12Ast__scope_t hd;
} _fx_LN12Ast__scope_t_data_t, *_fx_LN12Ast__scope_t;

typedef struct _fx_R16Ast__val_flags_t {
   bool val_flag_arg;
   bool val_flag_mutable;
   bool val_flag_temp;
   bool val_flag_tempref;
   bool val_flag_private;
   bool val_flag_subarray;
   bool val_flag_instance;
   struct _fx_T2R9Ast__id_ti val_flag_method;
   int_ val_flag_ctor;
   struct _fx_LN12Ast__scope_t_data_t* val_flag_global;
} _fx_R16Ast__val_flags_t;

typedef struct _fx_N17Ast__fun_constr_t {
   int tag;
   union {
      int_ CtorVariant;
      struct _fx_R9Ast__id_t CtorFP;
      struct _fx_R9Ast__id_t CtorExn;
   } u;
} _fx_N17Ast__fun_constr_t;

typedef struct _fx_R16Ast__fun_flags_t {
   int_ fun_flag_pure;
   bool fun_flag_ccode;
   bool fun_flag_have_keywords;
   bool fun_flag_inline;
   bool fun_flag_nothrow;
   bool fun_flag_really_nothrow;
   bool fun_flag_private;
   struct _fx_N17Ast__fun_constr_t fun_flag_ctor;
   struct _fx_R9Ast__id_t fun_flag_method_of;
   bool fun_flag_uses_fv;
   bool fun_flag_recursive;
   bool fun_flag_instance;
} _fx_R16Ast__fun_flags_t;

typedef struct _fx_Ta2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
} _fx_Ta2R9Ast__id_t;

typedef struct _fx_LR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* tl;
   struct _fx_R9Ast__id_t hd;
} _fx_LR9Ast__id_t_data_t, *_fx_LR9Ast__id_t;

typedef struct _fx_R17K_form__kdefval_t {
   struct _fx_R9Ast__id_t kv_name;
   fx_str_t kv_cname;
   struct _fx_N14K_form__ktyp_t_data_t* kv_typ;
   struct _fx_R16Ast__val_flags_t kv_flags;
   struct _fx_R10Ast__loc_t kv_loc;
} _fx_R17K_form__kdefval_t;

typedef struct _fx_T2R9Ast__id_tN14K_form__ktyp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t hd;
} _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t, *_fx_LT2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_R23K_form__kdefinterface_t {
   struct _fx_R9Ast__id_t ki_name;
   struct _fx_R9Ast__id_t ki_base;
   fx_str_t ki_cname;
   struct _fx_R9Ast__id_t ki_id;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* ki_all_methods;
   struct _fx_LN12Ast__scope_t_data_t* ki_scope;
   struct _fx_R10Ast__loc_t ki_loc;
} _fx_R23K_form__kdefinterface_t;

typedef struct _fx_rR23K_form__kdefinterface_t_data_t {
   int_ rc;
   struct _fx_R23K_form__kdefinterface_t data;
} _fx_rR23K_form__kdefinterface_t_data_t, *_fx_rR23K_form__kdefinterface_t;

typedef struct _fx_R25K_form__kdefclosureinfo_t {
   struct _fx_R9Ast__id_t kci_arg;
   struct _fx_R9Ast__id_t kci_fcv_t;
   struct _fx_R9Ast__id_t kci_fp_typ;
   struct _fx_R9Ast__id_t kci_make_fp;
   struct _fx_R9Ast__id_t kci_wrap_f;
} _fx_R25K_form__kdefclosureinfo_t;

typedef struct _fx_R17K_form__kdeffun_t {
   struct _fx_R9Ast__id_t kf_name;
   fx_str_t kf_cname;
   struct _fx_LR9Ast__id_t_data_t* kf_params;
   struct _fx_N14K_form__ktyp_t_data_t* kf_rt;
   struct _fx_N14K_form__kexp_t_data_t* kf_body;
   struct _fx_R16Ast__fun_flags_t kf_flags;
   struct _fx_R25K_form__kdefclosureinfo_t kf_closure;
   struct _fx_LN12Ast__scope_t_data_t* kf_scope;
   struct _fx_R10Ast__loc_t kf_loc;
} _fx_R17K_form__kdeffun_t;

typedef struct _fx_rR17K_form__kdeffun_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdeffun_t data;
} _fx_rR17K_form__kdeffun_t_data_t, *_fx_rR17K_form__kdeffun_t;

typedef struct _fx_R17K_form__kdefexn_t {
   struct _fx_R9Ast__id_t ke_name;
   fx_str_t ke_cname;
   fx_str_t ke_base_cname;
   struct _fx_N14K_form__ktyp_t_data_t* ke_typ;
   bool ke_std;
   struct _fx_R9Ast__id_t ke_tag;
   struct _fx_R9Ast__id_t ke_make;
   struct _fx_LN12Ast__scope_t_data_t* ke_scope;
   struct _fx_R10Ast__loc_t ke_loc;
} _fx_R17K_form__kdefexn_t;

typedef struct _fx_rR17K_form__kdefexn_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdefexn_t data;
} _fx_rR17K_form__kdefexn_t_data_t, *_fx_rR17K_form__kdefexn_t;

typedef struct _fx_R17K_form__ktprops_t {
   bool ktp_complex;
   bool ktp_scalar;
   bool ktp_ptr;
   bool ktp_pass_by_ref;
   bool ktp_custom_free;
   bool ktp_custom_copy;
} _fx_R17K_form__ktprops_t;

typedef struct _fx_Nt6option1R17K_form__ktprops_t {
   int tag;
   union {
      struct _fx_R17K_form__ktprops_t Some;
   } u;
} _fx_Nt6option1R17K_form__ktprops_t;

typedef struct _fx_R16Ast__var_flags_t {
   int_ var_flag_class_from;
   bool var_flag_record;
   bool var_flag_recursive;
   bool var_flag_have_tag;
   bool var_flag_have_mutable;
   bool var_flag_opt;
   bool var_flag_instance;
} _fx_R16Ast__var_flags_t;

typedef struct _fx_LN14K_form__ktyp_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__ktyp_t_data_t* tl;
   struct _fx_N14K_form__ktyp_t_data_t* hd;
} _fx_LN14K_form__ktyp_t_data_t, *_fx_LN14K_form__ktyp_t;

typedef struct _fx_T2R9Ast__id_tLR9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
} _fx_T2R9Ast__id_tLR9Ast__id_t;

typedef struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* tl;
   struct _fx_T2R9Ast__id_tLR9Ast__id_t hd;
} _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t, *_fx_LT2R9Ast__id_tLR9Ast__id_t;

typedef struct _fx_R21K_form__kdefvariant_t {
   struct _fx_R9Ast__id_t kvar_name;
   fx_str_t kvar_cname;
   struct _fx_R9Ast__id_t kvar_proto;
   struct _fx_Nt6option1R17K_form__ktprops_t kvar_props;
   struct _fx_LN14K_form__ktyp_t_data_t* kvar_targs;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* kvar_cases;
   struct _fx_LR9Ast__id_t_data_t* kvar_ctors;
   struct _fx_R16Ast__var_flags_t kvar_flags;
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* kvar_ifaces;
   struct _fx_LN12Ast__scope_t_data_t* kvar_scope;
   struct _fx_R10Ast__loc_t kvar_loc;
} _fx_R21K_form__kdefvariant_t;

typedef struct _fx_rR21K_form__kdefvariant_t_data_t {
   int_ rc;
   struct _fx_R21K_form__kdefvariant_t data;
} _fx_rR21K_form__kdefvariant_t_data_t, *_fx_rR21K_form__kdefvariant_t;

typedef struct _fx_R17K_form__kdeftyp_t {
   struct _fx_R9Ast__id_t kt_name;
   fx_str_t kt_cname;
   struct _fx_R9Ast__id_t kt_proto;
   struct _fx_Nt6option1R17K_form__ktprops_t kt_props;
   struct _fx_LN14K_form__ktyp_t_data_t* kt_targs;
   struct _fx_N14K_form__ktyp_t_data_t* kt_typ;
   struct _fx_LN12Ast__scope_t_data_t* kt_scope;
   struct _fx_R10Ast__loc_t kt_loc;
} _fx_R17K_form__kdeftyp_t;

typedef struct _fx_rR17K_form__kdeftyp_t_data_t {
   int_ rc;
   struct _fx_R17K_form__kdeftyp_t data;
} _fx_rR17K_form__kdeftyp_t_data_t, *_fx_rR17K_form__kdeftyp_t;

typedef struct _fx_R25K_form__kdefclosurevars_t {
   struct _fx_R9Ast__id_t kcv_name;
   fx_str_t kcv_cname;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* kcv_freevars;
   struct _fx_LR9Ast__id_t_data_t* kcv_orig_freevars;
   struct _fx_LN12Ast__scope_t_data_t* kcv_scope;
   struct _fx_R10Ast__loc_t kcv_loc;
} _fx_R25K_form__kdefclosurevars_t;

typedef struct _fx_rR25K_form__kdefclosurevars_t_data_t {
   int_ rc;
   struct _fx_R25K_form__kdefclosurevars_t data;
} _fx_rR25K_form__kdefclosurevars_t_data_t, *_fx_rR25K_form__kdefclosurevars_t;

typedef struct _fx_N15K_form__kinfo_t {
   int tag;
   union {
      struct _fx_R17K_form__kdefval_t KVal;
      struct _fx_rR17K_form__kdeffun_t_data_t* KFun;
      struct _fx_rR17K_form__kdefexn_t_data_t* KExn;
      struct _fx_rR21K_form__kdefvariant_t_data_t* KVariant;
      struct _fx_rR25K_form__kdefclosurevars_t_data_t* KClosureVars;
      struct _fx_rR23K_form__kdefinterface_t_data_t* KInterface;
      struct _fx_rR17K_form__kdeftyp_t_data_t* KTyp;
   } u;
} _fx_N15K_form__kinfo_t;

typedef struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t {
   int_ t0;
   fx_arr_t t1;
   struct _fx_N15K_form__kinfo_t t2;
} _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t;

typedef struct _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t {
   int_ rc;
   union {
      struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t t;
   } u;
} _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t, *_fx_Nt9Dynvec__t1N15K_form__kinfo_t;

typedef struct _fx_Nt6option1R9Ast__id_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t Some;
   } u;
} _fx_Nt6option1R9Ast__id_t;

typedef struct _fx_Nt6option1N10Ast__exp_t_data_t {
   int_ rc;
   union {
      struct _fx_N10Ast__exp_t_data_t* Some;
   } u;
} _fx_Nt6option1N10Ast__exp_t_data_t, *_fx_Nt6option1N10Ast__exp_t;

typedef struct _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t {
   uint64_t hv;
   struct _fx_R9Ast__id_t key;
} _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t;

typedef struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t {
   struct _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t t0;
   int_ t1;
   int_ t2;
   int_ t3;
   fx_arr_t t4;
   fx_arr_t t5;
} _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t;

typedef struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t {
   int_ rc;
   union {
      struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t t;
   } u;
} _fx_Nt10Hashset__t1R9Ast__id_t_data_t, *_fx_Nt10Hashset__t1R9Ast__id_t;

typedef struct _fx_R13Ast__defval_t {
   struct _fx_R9Ast__id_t dv_name;
   struct _fx_N10Ast__typ_t_data_t* dv_typ;
   struct _fx_R16Ast__val_flags_t dv_flags;
   struct _fx_LN12Ast__scope_t_data_t* dv_scope;
   struct _fx_R10Ast__loc_t dv_loc;
} _fx_R13Ast__defval_t;

typedef struct _fx_FPi2R9Ast__id_tR9Ast__id_t {
   int (*fp)(struct _fx_R9Ast__id_t*, struct _fx_R9Ast__id_t*, int_*, void*);
   fx_fcv_t* fcv;
} _fx_FPi2R9Ast__id_tR9Ast__id_t;

typedef struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* root;
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t cmp;
} _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_LN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__pat_t_data_t* tl;
   struct _fx_N10Ast__pat_t_data_t* hd;
} _fx_LN10Ast__pat_t_data_t, *_fx_LN10Ast__pat_t;

typedef struct _fx_rLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LR9Ast__id_t_data_t* data;
} _fx_rLR9Ast__id_t_data_t, *_fx_rLR9Ast__id_t;

typedef struct _fx_R13Ast__deffun_t {
   struct _fx_R9Ast__id_t df_name;
   struct _fx_LR9Ast__id_t_data_t* df_templ_args;
   struct _fx_LN10Ast__pat_t_data_t* df_args;
   struct _fx_N10Ast__typ_t_data_t* df_typ;
   struct _fx_N10Ast__exp_t_data_t* df_body;
   struct _fx_R16Ast__fun_flags_t df_flags;
   struct _fx_LN12Ast__scope_t_data_t* df_scope;
   struct _fx_R10Ast__loc_t df_loc;
   struct _fx_rLR9Ast__id_t_data_t* df_templ_inst;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t df_env;
} _fx_R13Ast__deffun_t;

typedef struct _fx_rR13Ast__deffun_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deffun_t data;
} _fx_rR13Ast__deffun_t_data_t, *_fx_rR13Ast__deffun_t;

typedef struct _fx_R13Ast__defexn_t {
   struct _fx_R9Ast__id_t dexn_name;
   struct _fx_N10Ast__typ_t_data_t* dexn_typ;
   struct _fx_LN12Ast__scope_t_data_t* dexn_scope;
   struct _fx_R10Ast__loc_t dexn_loc;
} _fx_R13Ast__defexn_t;

typedef struct _fx_rR13Ast__defexn_t_data_t {
   int_ rc;
   struct _fx_R13Ast__defexn_t data;
} _fx_rR13Ast__defexn_t_data_t, *_fx_rR13Ast__defexn_t;

typedef struct _fx_R13Ast__deftyp_t {
   struct _fx_R9Ast__id_t dt_name;
   struct _fx_LR9Ast__id_t_data_t* dt_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dt_typ;
   bool dt_finalized;
   struct _fx_LN12Ast__scope_t_data_t* dt_scope;
   struct _fx_R10Ast__loc_t dt_loc;
} _fx_R13Ast__deftyp_t;

typedef struct _fx_rR13Ast__deftyp_t_data_t {
   int_ rc;
   struct _fx_R13Ast__deftyp_t data;
} _fx_rR13Ast__deftyp_t_data_t, *_fx_rR13Ast__deftyp_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__typ_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__typ_t hd;
} _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__typ_t;

typedef struct _fx_LTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LTa2R9Ast__id_t_data_t* tl;
   struct _fx_Ta2R9Ast__id_t hd;
} _fx_LTa2R9Ast__id_t_data_t, *_fx_LTa2R9Ast__id_t;

typedef struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LTa2R9Ast__id_t_data_t* t1;
} _fx_T2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl;
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t hd;
} _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t, *_fx_LT2R9Ast__id_tLTa2R9Ast__id_t;

typedef struct _fx_R17Ast__defvariant_t {
   struct _fx_R9Ast__id_t dvar_name;
   struct _fx_LR9Ast__id_t_data_t* dvar_templ_args;
   struct _fx_N10Ast__typ_t_data_t* dvar_alias;
   struct _fx_R16Ast__var_flags_t dvar_flags;
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* dvar_cases;
   struct _fx_LR9Ast__id_t_data_t* dvar_ctors;
   struct _fx_rLR9Ast__id_t_data_t* dvar_templ_inst;
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* dvar_ifaces;
   struct _fx_LN12Ast__scope_t_data_t* dvar_scope;
   struct _fx_R10Ast__loc_t dvar_loc;
} _fx_R17Ast__defvariant_t;

typedef struct _fx_rR17Ast__defvariant_t_data_t {
   int_ rc;
   struct _fx_R17Ast__defvariant_t data;
} _fx_rR17Ast__defvariant_t_data_t, *_fx_rR17Ast__defvariant_t;

typedef struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R16Ast__fun_flags_t t2;
} _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t {
   int_ rc;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl;
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t hd;
} _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t, *_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t;

typedef struct _fx_R19Ast__definterface_t {
   struct _fx_R9Ast__id_t di_name;
   struct _fx_R9Ast__id_t di_base;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_new_methods;
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* di_all_methods;
   struct _fx_LN12Ast__scope_t_data_t* di_scope;
   struct _fx_R10Ast__loc_t di_loc;
} _fx_R19Ast__definterface_t;

typedef struct _fx_rR19Ast__definterface_t_data_t {
   int_ rc;
   struct _fx_R19Ast__definterface_t data;
} _fx_rR19Ast__definterface_t_data_t, *_fx_rR19Ast__definterface_t;

typedef struct _fx_N14Ast__id_info_t {
   int tag;
   union {
      struct _fx_R13Ast__defval_t IdDVal;
      struct _fx_rR13Ast__deffun_t_data_t* IdFun;
      struct _fx_rR13Ast__defexn_t_data_t* IdExn;
      struct _fx_rR13Ast__deftyp_t_data_t* IdTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* IdVariant;
      struct _fx_rR19Ast__definterface_t_data_t* IdInterface;
      int_ IdModule;
   } u;
} _fx_N14Ast__id_info_t;

typedef struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t {
   int_ t0;
   fx_arr_t t1;
   struct _fx_N14Ast__id_info_t t2;
} _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t;

typedef struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t {
   int_ rc;
   union {
      struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t t;
   } u;
} _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t, *_fx_Nt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N12Map__color_t {
   int tag;
} _fx_N12Map__color_t;

typedef struct _fx_LN16Ast__env_entry_t_data_t {
   int_ rc;
   struct _fx_LN16Ast__env_entry_t_data_t* tl;
   struct _fx_N16Ast__env_entry_t_data_t* hd;
} _fx_LN16Ast__env_entry_t_data_t, *_fx_LN16Ast__env_entry_t;

typedef struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t {
   struct _fx_N12Map__color_t t0;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1;
   struct _fx_R9Ast__id_t t2;
   struct _fx_LN16Ast__env_entry_t_data_t* t3;
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4;
} _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t {
   int_ rc;
   union {
      struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t
         Node;
   } u;
} _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t, *_fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t;

typedef struct _fx_T2R10Ast__loc_tS {
   struct _fx_R10Ast__loc_t t0;
   fx_str_t t1;
} _fx_T2R10Ast__loc_tS;

typedef struct _fx_T2il {
   int_ t0;
   int64_t t1;
} _fx_T2il;

typedef struct _fx_T2iq {
   int_ t0;
   uint64_t t1;
} _fx_T2iq;

typedef struct _fx_T2id {
   int_ t0;
   double t1;
} _fx_T2id;

typedef struct _fx_N10Ast__lit_t {
   int tag;
   union {
      int64_t LitInt;
      struct _fx_T2il LitSInt;
      struct _fx_T2iq LitUInt;
      struct _fx_T2id LitFloat;
      fx_str_t LitString;
      char_ LitChar;
      bool LitBool;
   } u;
} _fx_N10Ast__lit_t;

typedef struct _fx_rNt6option1N10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_Nt6option1N10Ast__typ_t_data_t* data;
} _fx_rNt6option1N10Ast__typ_t_data_t, *_fx_rNt6option1N10Ast__typ_t;

typedef struct _fx_LN10Ast__typ_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__typ_t_data_t* tl;
   struct _fx_N10Ast__typ_t_data_t* hd;
} _fx_LN10Ast__typ_t_data_t, *_fx_LN10Ast__typ_t;

typedef struct _fx_T2LN10Ast__typ_tN10Ast__typ_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2LN10Ast__typ_tN10Ast__typ_t;

typedef struct _fx_T2iN10Ast__typ_t {
   int_ t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
} _fx_T2iN10Ast__typ_t;

typedef struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t {
   struct _fx_R16Ast__val_flags_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_N10Ast__typ_t_data_t* t2;
   struct _fx_N10Ast__exp_t_data_t* t3;
} _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl;
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t hd;
} _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t, *_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t;

typedef struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB {
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0;
   bool t1;
} _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t {
   int_ rc;
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB data;
} _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t, *_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB;

typedef struct _fx_T2LN10Ast__typ_tR9Ast__id_t {
   struct _fx_LN10Ast__typ_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2LN10Ast__typ_tR9Ast__id_t;

typedef struct _fx_N10Ast__typ_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_rNt6option1N10Ast__typ_t_data_t* TypVar;
      struct _fx_Nt6option1N10Ast__typ_t_data_t* TypVarTuple;
      struct _fx_N10Ast__typ_t_data_t* TypVarArray;
      int_ TypSInt;
      int_ TypUInt;
      int_ TypFloat;
      struct _fx_T2LN10Ast__typ_tN10Ast__typ_t TypFun;
      struct _fx_N10Ast__typ_t_data_t* TypList;
      struct _fx_N10Ast__typ_t_data_t* TypVector;
      struct _fx_LN10Ast__typ_t_data_t* TypTuple;
      struct _fx_N10Ast__typ_t_data_t* TypRef;
      struct _fx_T2iN10Ast__typ_t TypArray;
      struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t* TypRecord;
      struct _fx_T2LN10Ast__typ_tR9Ast__id_t TypApp;
   } u;
} _fx_N10Ast__typ_t_data_t, *_fx_N10Ast__typ_t;

typedef struct _fx_N12Ast__cmpop_t {
   int tag;
} _fx_N12Ast__cmpop_t;

typedef struct _fx_N13Ast__binary_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_N12Ast__cmpop_t OpCmp;
      struct _fx_N12Ast__cmpop_t OpDotCmp;
      struct _fx_N13Ast__binary_t_data_t* OpAugBinary;
   } u;
} _fx_N13Ast__binary_t_data_t, *_fx_N13Ast__binary_t;

typedef struct _fx_N12Ast__unary_t {
   int tag;
} _fx_N12Ast__unary_t;

typedef struct _fx_N12Ast__sctyp_t {
   int tag;
} _fx_N12Ast__sctyp_t;

typedef struct _fx_N13Ast__intrin_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t IntrinMath;
      struct _fx_N12Ast__sctyp_t IntrinSaturate;
   } u;
} _fx_N13Ast__intrin_t;

typedef struct _fx_N15Ast__for_make_t {
   int tag;
} _fx_N15Ast__for_make_t;

typedef struct _fx_R16Ast__for_flags_t {
   bool for_flag_parallel;
   struct _fx_N15Ast__for_make_t for_flag_make;
   bool for_flag_unzip;
   bool for_flag_fold;
   bool for_flag_nested;
} _fx_R16Ast__for_flags_t;

typedef struct _fx_N13Ast__border_t {
   int tag;
} _fx_N13Ast__border_t;

typedef struct _fx_N18Ast__interpolate_t {
   int tag;
} _fx_N18Ast__interpolate_t;

typedef struct _fx_T2BR10Ast__loc_t {
   bool t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2BR10Ast__loc_t;

typedef struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__typ_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1;
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N12Ast__unary_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LN10Ast__exp_t_data_t* tl;
   struct _fx_N10Ast__exp_t_data_t* hd;
} _fx_LN10Ast__exp_t_data_t, *_fx_LN10Ast__exp_t;

typedef struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N13Ast__intrin_t t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__exp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LLN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LLN10Ast__exp_t_data_t* tl;
   struct _fx_LN10Ast__exp_t_data_t* hd;
} _fx_LLN10Ast__exp_t_data_t, *_fx_LLN10Ast__exp_t;

typedef struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LLN10Ast__exp_t_data_t* t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__exp_t hd;
} _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__exp_t;

typedef struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N13Ast__border_t t1;
   struct _fx_N18Ast__interpolate_t t2;
   struct _fx_LN10Ast__exp_t_data_t* t3;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t4;
} _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tN10Ast__exp_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
} _fx_T2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t {
   int_ rc;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl;
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t hd;
} _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t, *_fx_LT2N10Ast__pat_tN10Ast__exp_t;

typedef struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_N10Ast__exp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
   struct _fx_R10Ast__loc_t t4;
} _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t {
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t hd;
} _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t, *_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t;

typedef struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t3;
} _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__exp_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t1;
} _fx_T2ST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t {
   fx_str_t t0;
   fx_str_t t1;
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t t2;
} _fx_T3SST2N10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R16Ast__val_flags_t t2;
   struct _fx_R10Ast__loc_t t3;
} _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t;

typedef struct _fx_T2iR9Ast__id_t {
   int_ t0;
   struct _fx_R9Ast__id_t t1;
} _fx_T2iR9Ast__id_t;

typedef struct _fx_LT2iR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT2iR9Ast__id_t_data_t* tl;
   struct _fx_T2iR9Ast__id_t hd;
} _fx_LT2iR9Ast__id_t_data_t, *_fx_LT2iR9Ast__id_t;

typedef struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t {
   struct _fx_LT2iR9Ast__id_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LT2iR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3iLR9Ast__id_tR10Ast__loc_t {
   int_ t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3iLR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LSR10Ast__loc_t {
   struct _fx_LS_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LSR10Ast__loc_t;

typedef struct _fx_N10Ast__exp_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t ExpNop;
      struct _fx_T2BR10Ast__loc_t ExpBreak;
      struct _fx_R10Ast__loc_t ExpContinue;
      struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t ExpReturn;
      struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpRange;
      struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t ExpLit;
      struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t ExpIdent;
      struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpBinary;
      struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUnary;
      struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIntrin;
      struct _fx_T2R9Ast__id_tN10Ast__exp_t ExpSync;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpSeq;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkTuple;
      struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkArray;
      struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkVector;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMkRecord;
      struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpUpdateRecord;
      struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpCall;
      struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpAt;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpAssign;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMem;
      struct _fx_T2N10Ast__exp_tR10Ast__loc_t ExpThrow;
      struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpIf;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpWhile;
      struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t ExpDoWhile;
      struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t ExpFor;
      struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t
         ExpMap;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpTryCatch;
      struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t ExpMatch;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpCast;
      struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t ExpTyped;
      struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t ExpCCode;
      struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t ExpData;
      struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t DefVal;
      struct _fx_rR13Ast__deffun_t_data_t* DefFun;
      struct _fx_rR13Ast__defexn_t_data_t* DefExn;
      struct _fx_rR13Ast__deftyp_t_data_t* DefTyp;
      struct _fx_rR17Ast__defvariant_t_data_t* DefVariant;
      struct _fx_rR19Ast__definterface_t_data_t* DefInterface;
      struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t DirImport;
      struct _fx_T3iLR9Ast__id_tR10Ast__loc_t DirImportFrom;
      struct _fx_T2LSR10Ast__loc_t DirPragma;
   } u;
} _fx_N10Ast__exp_t_data_t, *_fx_N10Ast__exp_t;

typedef struct _fx_T2N10Ast__lit_tR10Ast__loc_t {
   struct _fx_N10Ast__lit_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__lit_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2R9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T2LN10Ast__pat_tR10Ast__loc_t {
   struct _fx_LN10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2LN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN10Ast__pat_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
} _fx_T2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN10Ast__pat_t hd;
} _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t, *_fx_LT2R9Ast__id_tN10Ast__pat_t;

typedef struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_Nt6option1R9Ast__id_t t0;
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__pat_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__typ_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t;

typedef struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_N10Ast__exp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t;

typedef struct _fx_T2N10Ast__pat_tR10Ast__loc_t {
   struct _fx_N10Ast__pat_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N10Ast__pat_tR10Ast__loc_t;

typedef struct _fx_N10Ast__pat_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t PatAny;
      struct _fx_T2N10Ast__lit_tR10Ast__loc_t PatLit;
      struct _fx_T2R9Ast__id_tR10Ast__loc_t PatIdent;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatTuple;
      struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t PatVariant;
      struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t PatRecord;
      struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t PatCons;
      struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t PatAs;
      struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t PatTyped;
      struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t PatWhen;
      struct _fx_T2LN10Ast__pat_tR10Ast__loc_t PatAlt;
      struct _fx_T2N10Ast__pat_tR10Ast__loc_t PatRef;
   } u;
} _fx_N10Ast__pat_t_data_t, *_fx_N10Ast__pat_t;

typedef struct _fx_N16Ast__env_entry_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R9Ast__id_t EnvId;
      struct _fx_N10Ast__typ_t_data_t* EnvTyp;
   } u;
} _fx_N16Ast__env_entry_t_data_t, *_fx_N16Ast__env_entry_t;

typedef struct _fx_Li_data_t {
   int_ rc;
   struct _fx_Li_data_t* tl;
   int_ hd;
} _fx_Li_data_t, *_fx_Li;

typedef struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t {
   struct _fx_R9Ast__id_t t0;
   fx_str_t t1;
   int_ t2;
   bool t3;
   struct _fx_LN10Ast__exp_t_data_t* t4;
   struct _fx_Li_data_t* t5;
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t t6;
   bool t7;
   int_ t8;
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9;
} _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t;

typedef struct _fx_N16Ast__defmodule_t_data_t {
   int_ rc;
   union {
      struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t
         defmodule_t;
   } u;
} _fx_N16Ast__defmodule_t_data_t, *_fx_N16Ast__defmodule_t;

typedef struct _fx_LR10Ast__loc_t_data_t {
   int_ rc;
   struct _fx_LR10Ast__loc_t_data_t* tl;
   struct _fx_R10Ast__loc_t hd;
} _fx_LR10Ast__loc_t_data_t, *_fx_LR10Ast__loc_t;

typedef struct _fx_Nt6option1N14K_form__kexp_t {
   int tag;
   union {
      struct _fx_N14K_form__kexp_t_data_t* Some;
   } u;
} _fx_Nt6option1N14K_form__kexp_t;

typedef struct _fx_Nt6option1rR23K_form__kdefinterface_t {
   int tag;
   union {
      struct _fx_rR23K_form__kdefinterface_t_data_t* Some;
   } u;
} _fx_Nt6option1rR23K_form__kdefinterface_t;

typedef struct _fx_N14K_form__klit_t {
   int tag;
   union {
      int64_t KLitInt;
      struct _fx_T2il KLitSInt;
      struct _fx_T2iq KLitUInt;
      struct _fx_T2id KLitFloat;
      fx_str_t KLitString;
      char_ KLitChar;
      bool KLitBool;
      struct _fx_N14K_form__ktyp_t_data_t* KLitNil;
   } u;
} _fx_N14K_form__klit_t;

typedef struct _fx_N14K_form__atom_t {
   int tag;
   union {
      struct _fx_R9Ast__id_t AtomId;
      struct _fx_N14K_form__klit_t AtomLit;
   } u;
} _fx_N14K_form__atom_t;

typedef struct _fx_R22K_form__k_fold_callb_t {
   struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t* kcb_fold_ktyp;
   struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t* kcb_fold_kexp;
   struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t* kcb_fold_atom;
} _fx_R22K_form__k_fold_callb_t;

typedef struct _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t {
   int (*fp)(struct _fx_N14K_form__atom_t*, struct _fx_R10Ast__loc_t*, struct _fx_R22K_form__k_fold_callb_t*, void*);
   fx_fcv_t* fcv;
} _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t;

typedef struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t Some;
   } u;
} _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t, *_fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t;

typedef struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t {
   int (*fp)(struct _fx_N14K_form__kexp_t_data_t*, struct _fx_R22K_form__k_fold_callb_t*, void*);
   fx_fcv_t* fcv;
} _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t;

typedef struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t Some;
   } u;
} _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t, *_fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t;

typedef struct _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t {
   int (*fp)(struct _fx_N14K_form__ktyp_t_data_t*, struct _fx_R10Ast__loc_t*, struct _fx_R22K_form__k_fold_callb_t*, void*);
   fx_fcv_t* fcv;
} _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t;

typedef struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t Some;
   } u;
} _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t, *_fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t;

typedef struct _fx_R17K_form__k_callb_t {
   struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t* kcb_ktyp;
   struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t* kcb_kexp;
   struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t* kcb_atom;
} _fx_R17K_form__k_callb_t;

typedef struct _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t {
   int (*fp)(
      struct _fx_N14K_form__atom_t*, struct _fx_R10Ast__loc_t*, struct _fx_R17K_form__k_callb_t*, struct _fx_N14K_form__atom_t*,
         void*);
   fx_fcv_t* fcv;
} _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t;

typedef struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t Some;
   } u;
} _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t, *_fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t;

typedef struct _fx_FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t {
   int (*fp)(
      struct _fx_N14K_form__kexp_t_data_t*, struct _fx_R17K_form__k_callb_t*, struct _fx_N14K_form__kexp_t_data_t**, void*);
   fx_fcv_t* fcv;
} _fx_FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t;

typedef struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t Some;
   } u;
} _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t, *_fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t;

typedef struct _fx_FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t {
   int (*fp)(
      struct _fx_N14K_form__ktyp_t_data_t*, struct _fx_R10Ast__loc_t*, struct _fx_R17K_form__k_callb_t*,
         struct _fx_N14K_form__ktyp_t_data_t**, void*);
   fx_fcv_t* fcv;
} _fx_FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t;

typedef struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t {
   int_ rc;
   union {
      struct _fx_FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t Some;
   } u;
} _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t, *_fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t;

typedef struct _fx_Nt6option1N14K_form__atom_t {
   int tag;
   union {
      struct _fx_N14K_form__atom_t Some;
   } u;
} _fx_Nt6option1N14K_form__atom_t;

typedef struct _fx_LN14K_form__kexp_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__kexp_t_data_t* tl;
   struct _fx_N14K_form__kexp_t_data_t* hd;
} _fx_LN14K_form__kexp_t_data_t, *_fx_LN14K_form__kexp_t;

typedef struct _fx_T2BN14K_form__atom_t {
   bool t0;
   struct _fx_N14K_form__atom_t t1;
} _fx_T2BN14K_form__atom_t;

typedef struct _fx_LT2BN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LT2BN14K_form__atom_t_data_t* tl;
   struct _fx_T2BN14K_form__atom_t hd;
} _fx_LT2BN14K_form__atom_t_data_t, *_fx_LT2BN14K_form__atom_t;

typedef struct _fx_FPv1N14K_form__kexp_t {
   int (*fp)(struct _fx_N14K_form__kexp_t_data_t*, void*);
   fx_fcv_t* fcv;
} _fx_FPv1N14K_form__kexp_t;

typedef struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t {
   struct _fx_LN14K_form__ktyp_t_data_t* t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t;

typedef struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1;
} _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t;

typedef struct _fx_T2iN14K_form__ktyp_t {
   int_ t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
} _fx_T2iN14K_form__ktyp_t;

typedef struct _fx_N14K_form__ktyp_t_data_t {
   int_ rc;
   int tag;
   union {
      int_ KTypSInt;
      int_ KTypUInt;
      int_ KTypFloat;
      struct _fx_N14K_form__ktyp_t_data_t* KTypRawPointer;
      struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t KTypFun;
      struct _fx_LN14K_form__ktyp_t_data_t* KTypTuple;
      struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t KTypRecord;
      struct _fx_R9Ast__id_t KTypName;
      struct _fx_T2iN14K_form__ktyp_t KTypArray;
      struct _fx_N14K_form__ktyp_t_data_t* KTypVector;
      struct _fx_N14K_form__ktyp_t_data_t* KTypList;
      struct _fx_N14K_form__ktyp_t_data_t* KTypRef;
   } u;
} _fx_N14K_form__ktyp_t_data_t, *_fx_N14K_form__ktyp_t;

typedef struct _fx_Ta3N14K_form__atom_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_N14K_form__atom_t t2;
} _fx_Ta3N14K_form__atom_t;

typedef struct _fx_N13K_form__dom_t {
   int tag;
   union {
      struct _fx_N14K_form__atom_t DomainElem;
      struct _fx_N14K_form__atom_t DomainFast;
      struct _fx_Ta3N14K_form__atom_t DomainRange;
   } u;
} _fx_N13K_form__dom_t;

typedef struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t {
   struct _fx_Nt6option1N14K_form__atom_t t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t;

typedef struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__ktyp_t_data_t* t0;
   struct _fx_R10Ast__loc_t t1;
} _fx_T2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N13Ast__binary_t_data_t* t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_N14K_form__atom_t t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N12Ast__unary_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LN14K_form__atom_t_data_t* tl;
   struct _fx_N14K_form__atom_t hd;
} _fx_LN14K_form__atom_t_data_t, *_fx_LN14K_form__atom_t;

typedef struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N13Ast__intrin_t t0;
   struct _fx_LN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
} _fx_T2R9Ast__id_tN14K_form__kexp_t;

typedef struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_N14K_form__kexp_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_LN14K_form__atom_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LN14K_form__atom_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_R9Ast__id_t t1;
   struct _fx_LN14K_form__atom_t_data_t* t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LLT2BN14K_form__atom_t_data_t {
   int_ rc;
   struct _fx_LLT2BN14K_form__atom_t_data_t* tl;
   struct _fx_LT2BN14K_form__atom_t_data_t* hd;
} _fx_LLT2BN14K_form__atom_t_data_t, *_fx_LLT2BN14K_form__atom_t;

typedef struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   bool t0;
   struct _fx_LLT2BN14K_form__atom_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT2BN14K_form__atom_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_LN13K_form__dom_t_data_t {
   int_ rc;
   struct _fx_LN13K_form__dom_t_data_t* tl;
   struct _fx_N13K_form__dom_t hd;
} _fx_LN13K_form__dom_t_data_t, *_fx_LN13K_form__dom_t;

typedef struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N13Ast__border_t t1;
   struct _fx_N18Ast__interpolate_t t2;
   struct _fx_LN13K_form__dom_t_data_t* t3;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t4;
} _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   int_ t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__atom_t t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t;

typedef struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t {
   struct _fx_LN14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
} _fx_T2LN14K_form__kexp_tN14K_form__kexp_t;

typedef struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t {
   int_ rc;
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* tl;
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t hd;
} _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t, *_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t;

typedef struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t2;
} _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tBR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   bool t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tBR10Ast__loc_t;

typedef struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_N14K_form__ktyp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T2R9Ast__id_tN13K_form__dom_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N13K_form__dom_t t1;
} _fx_T2R9Ast__id_tN13K_form__dom_t;

typedef struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t {
   int_ rc;
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* tl;
   struct _fx_T2R9Ast__id_tN13K_form__dom_t hd;
} _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t, *_fx_LT2R9Ast__id_tN13K_form__dom_t;

typedef struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t1;
   struct _fx_LR9Ast__id_t_data_t* t2;
} _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t;

typedef struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t {
   int_ rc;
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* tl;
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t hd;
} _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t, *_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t;

typedef struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t {
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R16Ast__for_flags_t t2;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t3;
} _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t {
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
   struct _fx_N14K_form__kexp_t_data_t* t2;
   struct _fx_R16Ast__for_flags_t t3;
   struct _fx_R10Ast__loc_t t4;
} _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t;

typedef struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t {
   struct _fx_N14K_form__kexp_t_data_t* t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t;

typedef struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t {
   fx_str_t t0;
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t t1;
} _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t;

typedef struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_N14K_form__kexp_t_data_t* t1;
   struct _fx_R10Ast__loc_t t2;
} _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t;

typedef struct _fx_N14K_form__kexp_t_data_t {
   int_ rc;
   int tag;
   union {
      struct _fx_R10Ast__loc_t KExpNop;
      struct _fx_R10Ast__loc_t KExpBreak;
      struct _fx_R10Ast__loc_t KExpContinue;
      struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t KExpReturn;
      struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpAtom;
      struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpBinary;
      struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpUnary;
      struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpIntrin;
      struct _fx_T2R9Ast__id_tN14K_form__kexp_t KExpSync;
      struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpSeq;
      struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpIf;
      struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpCall;
      struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpICall;
      struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkTuple;
      struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkRecord;
      struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkClosure;
      struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkArray;
      struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMkVector;
      struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t
         KExpAt;
      struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t KExpMem;
      struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t KExpAssign;
      struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpMatch;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t KExpTryCatch;
      struct _fx_T3R9Ast__id_tBR10Ast__loc_t KExpThrow;
      struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t KExpCast;
      struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t
         KExpMap;
      struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t KExpFor;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t KExpWhile;
      struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t KExpDoWhile;
      struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t KExpCCode;
      struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t KDefVal;
      struct _fx_rR17K_form__kdeffun_t_data_t* KDefFun;
      struct _fx_rR17K_form__kdefexn_t_data_t* KDefExn;
      struct _fx_rR21K_form__kdefvariant_t_data_t* KDefVariant;
      struct _fx_rR23K_form__kdefinterface_t_data_t* KDefInterface;
      struct _fx_rR17K_form__kdeftyp_t_data_t* KDefTyp;
      struct _fx_rR25K_form__kdefclosurevars_t_data_t* KDefClosureVars;
   } u;
} _fx_N14K_form__kexp_t_data_t, *_fx_N14K_form__kexp_t;

typedef struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t {
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t0;
   struct _fx_LR9Ast__id_t_data_t* t1;
} _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t;

typedef struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t {
   struct _fx_N14K_form__atom_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2N14K_form__atom_tLN14K_form__kexp_t;

typedef struct _fx_T2R9Ast__id_tLN14K_form__kexp_t {
   struct _fx_R9Ast__id_t t0;
   struct _fx_LN14K_form__kexp_t_data_t* t1;
} _fx_T2R9Ast__id_tLN14K_form__kexp_t;

typedef struct _fx_Ta2S {
   fx_str_t t0;
   fx_str_t t1;
} _fx_Ta2S;

typedef struct {
   int_ rc;
   int_ data;
} _fx_E4Exit_data_t;

typedef struct {
   int_ rc;
   fx_str_t data;
} _fx_E4Fail_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2Ta2iS data;
} _fx_E22LexerUtils__LexerError_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E17Ast__CompileError_data_t;

typedef struct {
   int_ rc;
   struct _fx_T2R10Ast__loc_tS data;
} _fx_E18Parser__ParseError_data_t;

static void _fx_free_Nt6option1N10Ast__typ_t(struct _fx_Nt6option1N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__typ_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LS(struct _fx_LS_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LS, fx_free_str);
}

static int _fx_cons_LS(fx_str_t* hd, struct _fx_LS_data_t* tl, bool addref_tl, struct _fx_LS_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LS, fx_copy_str);
}

static void _fx_free_T2Ta2iS(struct _fx_T2Ta2iS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2Ta2iS(struct _fx_T2Ta2iS* src, struct _fx_T2Ta2iS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2Ta2iS(struct _fx_Ta2i* t0, fx_str_t* t1, struct _fx_T2Ta2iS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static int _fx_cons_LN12Ast__scope_t(
   struct _fx_N12Ast__scope_t* hd,
   struct _fx_LN12Ast__scope_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN12Ast__scope_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN12Ast__scope_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* dst)
{
   fx_free_list_simple(&dst->val_flag_global);
}

static void _fx_copy_R16Ast__val_flags_t(struct _fx_R16Ast__val_flags_t* src, struct _fx_R16Ast__val_flags_t* dst)
{
   dst->val_flag_arg = src->val_flag_arg;
   dst->val_flag_mutable = src->val_flag_mutable;
   dst->val_flag_temp = src->val_flag_temp;
   dst->val_flag_tempref = src->val_flag_tempref;
   dst->val_flag_private = src->val_flag_private;
   dst->val_flag_subarray = src->val_flag_subarray;
   dst->val_flag_instance = src->val_flag_instance;
   dst->val_flag_method = src->val_flag_method;
   dst->val_flag_ctor = src->val_flag_ctor;
   FX_COPY_PTR(src->val_flag_global, &dst->val_flag_global);
}

static void _fx_make_R16Ast__val_flags_t(
   bool r_val_flag_arg,
   bool r_val_flag_mutable,
   bool r_val_flag_temp,
   bool r_val_flag_tempref,
   bool r_val_flag_private,
   bool r_val_flag_subarray,
   bool r_val_flag_instance,
   struct _fx_T2R9Ast__id_ti* r_val_flag_method,
   int_ r_val_flag_ctor,
   struct _fx_LN12Ast__scope_t_data_t* r_val_flag_global,
   struct _fx_R16Ast__val_flags_t* fx_result)
{
   fx_result->val_flag_arg = r_val_flag_arg;
   fx_result->val_flag_mutable = r_val_flag_mutable;
   fx_result->val_flag_temp = r_val_flag_temp;
   fx_result->val_flag_tempref = r_val_flag_tempref;
   fx_result->val_flag_private = r_val_flag_private;
   fx_result->val_flag_subarray = r_val_flag_subarray;
   fx_result->val_flag_instance = r_val_flag_instance;
   fx_result->val_flag_method = *r_val_flag_method;
   fx_result->val_flag_ctor = r_val_flag_ctor;
   FX_COPY_PTR(r_val_flag_global, &fx_result->val_flag_global);
}

static int _fx_cons_LR9Ast__id_t(
   struct _fx_R9Ast__id_t* hd,
   struct _fx_LR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_R17K_form__kdefval_t(struct _fx_R17K_form__kdefval_t* dst)
{
   fx_free_str(&dst->kv_cname);
   _fx_free_N14K_form__ktyp_t(&dst->kv_typ);
   _fx_free_R16Ast__val_flags_t(&dst->kv_flags);
}

static void _fx_copy_R17K_form__kdefval_t(struct _fx_R17K_form__kdefval_t* src, struct _fx_R17K_form__kdefval_t* dst)
{
   dst->kv_name = src->kv_name;
   fx_copy_str(&src->kv_cname, &dst->kv_cname);
   FX_COPY_PTR(src->kv_typ, &dst->kv_typ);
   _fx_copy_R16Ast__val_flags_t(&src->kv_flags, &dst->kv_flags);
   dst->kv_loc = src->kv_loc;
}

static void _fx_make_R17K_form__kdefval_t(
   struct _fx_R9Ast__id_t* r_kv_name,
   fx_str_t* r_kv_cname,
   struct _fx_N14K_form__ktyp_t_data_t* r_kv_typ,
   struct _fx_R16Ast__val_flags_t* r_kv_flags,
   struct _fx_R10Ast__loc_t* r_kv_loc,
   struct _fx_R17K_form__kdefval_t* fx_result)
{
   fx_result->kv_name = *r_kv_name;
   fx_copy_str(r_kv_cname, &fx_result->kv_cname);
   FX_COPY_PTR(r_kv_typ, &fx_result->kv_typ);
   _fx_copy_R16Ast__val_flags_t(r_kv_flags, &fx_result->kv_flags);
   fx_result->kv_loc = *r_kv_loc;
}

static void _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* src,
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN14K_form__ktyp_t, _fx_free_T2R9Ast__id_tN14K_form__ktyp_t);
}

static int _fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tN14K_form__ktyp_t* hd,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN14K_form__ktyp_t, _fx_copy_T2R9Ast__id_tN14K_form__ktyp_t);
}

static void _fx_free_R23K_form__kdefinterface_t(struct _fx_R23K_form__kdefinterface_t* dst)
{
   fx_free_str(&dst->ki_cname);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->ki_all_methods);
   fx_free_list_simple(&dst->ki_scope);
}

static void _fx_copy_R23K_form__kdefinterface_t(
   struct _fx_R23K_form__kdefinterface_t* src,
   struct _fx_R23K_form__kdefinterface_t* dst)
{
   dst->ki_name = src->ki_name;
   dst->ki_base = src->ki_base;
   fx_copy_str(&src->ki_cname, &dst->ki_cname);
   dst->ki_id = src->ki_id;
   FX_COPY_PTR(src->ki_all_methods, &dst->ki_all_methods);
   FX_COPY_PTR(src->ki_scope, &dst->ki_scope);
   dst->ki_loc = src->ki_loc;
}

static void _fx_make_R23K_form__kdefinterface_t(
   struct _fx_R9Ast__id_t* r_ki_name,
   struct _fx_R9Ast__id_t* r_ki_base,
   fx_str_t* r_ki_cname,
   struct _fx_R9Ast__id_t* r_ki_id,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_ki_all_methods,
   struct _fx_LN12Ast__scope_t_data_t* r_ki_scope,
   struct _fx_R10Ast__loc_t* r_ki_loc,
   struct _fx_R23K_form__kdefinterface_t* fx_result)
{
   fx_result->ki_name = *r_ki_name;
   fx_result->ki_base = *r_ki_base;
   fx_copy_str(r_ki_cname, &fx_result->ki_cname);
   fx_result->ki_id = *r_ki_id;
   FX_COPY_PTR(r_ki_all_methods, &fx_result->ki_all_methods);
   FX_COPY_PTR(r_ki_scope, &fx_result->ki_scope);
   fx_result->ki_loc = *r_ki_loc;
}

static void _fx_free_rR23K_form__kdefinterface_t(struct _fx_rR23K_form__kdefinterface_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR23K_form__kdefinterface_t, _fx_free_R23K_form__kdefinterface_t);
}

static int _fx_make_rR23K_form__kdefinterface_t(
   struct _fx_R23K_form__kdefinterface_t* arg,
   struct _fx_rR23K_form__kdefinterface_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR23K_form__kdefinterface_t, _fx_copy_R23K_form__kdefinterface_t);
}

static void _fx_free_R17K_form__kdeffun_t(struct _fx_R17K_form__kdeffun_t* dst)
{
   fx_free_str(&dst->kf_cname);
   fx_free_list_simple(&dst->kf_params);
   _fx_free_N14K_form__ktyp_t(&dst->kf_rt);
   _fx_free_N14K_form__kexp_t(&dst->kf_body);
   fx_free_list_simple(&dst->kf_scope);
}

static void _fx_copy_R17K_form__kdeffun_t(struct _fx_R17K_form__kdeffun_t* src, struct _fx_R17K_form__kdeffun_t* dst)
{
   dst->kf_name = src->kf_name;
   fx_copy_str(&src->kf_cname, &dst->kf_cname);
   FX_COPY_PTR(src->kf_params, &dst->kf_params);
   FX_COPY_PTR(src->kf_rt, &dst->kf_rt);
   FX_COPY_PTR(src->kf_body, &dst->kf_body);
   dst->kf_flags = src->kf_flags;
   dst->kf_closure = src->kf_closure;
   FX_COPY_PTR(src->kf_scope, &dst->kf_scope);
   dst->kf_loc = src->kf_loc;
}

static void _fx_make_R17K_form__kdeffun_t(
   struct _fx_R9Ast__id_t* r_kf_name,
   fx_str_t* r_kf_cname,
   struct _fx_LR9Ast__id_t_data_t* r_kf_params,
   struct _fx_N14K_form__ktyp_t_data_t* r_kf_rt,
   struct _fx_N14K_form__kexp_t_data_t* r_kf_body,
   struct _fx_R16Ast__fun_flags_t* r_kf_flags,
   struct _fx_R25K_form__kdefclosureinfo_t* r_kf_closure,
   struct _fx_LN12Ast__scope_t_data_t* r_kf_scope,
   struct _fx_R10Ast__loc_t* r_kf_loc,
   struct _fx_R17K_form__kdeffun_t* fx_result)
{
   fx_result->kf_name = *r_kf_name;
   fx_copy_str(r_kf_cname, &fx_result->kf_cname);
   FX_COPY_PTR(r_kf_params, &fx_result->kf_params);
   FX_COPY_PTR(r_kf_rt, &fx_result->kf_rt);
   FX_COPY_PTR(r_kf_body, &fx_result->kf_body);
   fx_result->kf_flags = *r_kf_flags;
   fx_result->kf_closure = *r_kf_closure;
   FX_COPY_PTR(r_kf_scope, &fx_result->kf_scope);
   fx_result->kf_loc = *r_kf_loc;
}

static void _fx_free_rR17K_form__kdeffun_t(struct _fx_rR17K_form__kdeffun_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdeffun_t, _fx_free_R17K_form__kdeffun_t);
}

static int _fx_make_rR17K_form__kdeffun_t(
   struct _fx_R17K_form__kdeffun_t* arg,
   struct _fx_rR17K_form__kdeffun_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdeffun_t, _fx_copy_R17K_form__kdeffun_t);
}

static void _fx_free_R17K_form__kdefexn_t(struct _fx_R17K_form__kdefexn_t* dst)
{
   fx_free_str(&dst->ke_cname);
   fx_free_str(&dst->ke_base_cname);
   _fx_free_N14K_form__ktyp_t(&dst->ke_typ);
   fx_free_list_simple(&dst->ke_scope);
}

static void _fx_copy_R17K_form__kdefexn_t(struct _fx_R17K_form__kdefexn_t* src, struct _fx_R17K_form__kdefexn_t* dst)
{
   dst->ke_name = src->ke_name;
   fx_copy_str(&src->ke_cname, &dst->ke_cname);
   fx_copy_str(&src->ke_base_cname, &dst->ke_base_cname);
   FX_COPY_PTR(src->ke_typ, &dst->ke_typ);
   dst->ke_std = src->ke_std;
   dst->ke_tag = src->ke_tag;
   dst->ke_make = src->ke_make;
   FX_COPY_PTR(src->ke_scope, &dst->ke_scope);
   dst->ke_loc = src->ke_loc;
}

static void _fx_make_R17K_form__kdefexn_t(
   struct _fx_R9Ast__id_t* r_ke_name,
   fx_str_t* r_ke_cname,
   fx_str_t* r_ke_base_cname,
   struct _fx_N14K_form__ktyp_t_data_t* r_ke_typ,
   bool r_ke_std,
   struct _fx_R9Ast__id_t* r_ke_tag,
   struct _fx_R9Ast__id_t* r_ke_make,
   struct _fx_LN12Ast__scope_t_data_t* r_ke_scope,
   struct _fx_R10Ast__loc_t* r_ke_loc,
   struct _fx_R17K_form__kdefexn_t* fx_result)
{
   fx_result->ke_name = *r_ke_name;
   fx_copy_str(r_ke_cname, &fx_result->ke_cname);
   fx_copy_str(r_ke_base_cname, &fx_result->ke_base_cname);
   FX_COPY_PTR(r_ke_typ, &fx_result->ke_typ);
   fx_result->ke_std = r_ke_std;
   fx_result->ke_tag = *r_ke_tag;
   fx_result->ke_make = *r_ke_make;
   FX_COPY_PTR(r_ke_scope, &fx_result->ke_scope);
   fx_result->ke_loc = *r_ke_loc;
}

static void _fx_free_rR17K_form__kdefexn_t(struct _fx_rR17K_form__kdefexn_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdefexn_t, _fx_free_R17K_form__kdefexn_t);
}

static int _fx_make_rR17K_form__kdefexn_t(
   struct _fx_R17K_form__kdefexn_t* arg,
   struct _fx_rR17K_form__kdefexn_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdefexn_t, _fx_copy_R17K_form__kdefexn_t);
}

static void _fx_free_LN14K_form__ktyp_t(struct _fx_LN14K_form__ktyp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__ktyp_t, _fx_free_N14K_form__ktyp_t);
}

static int _fx_cons_LN14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* hd,
   struct _fx_LN14K_form__ktyp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__ktyp_t, FX_COPY_PTR);
}

static void _fx_free_T2R9Ast__id_tLR9Ast__id_t(struct _fx_T2R9Ast__id_tLR9Ast__id_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLR9Ast__id_t(
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* src,
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLR9Ast__id_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tLR9Ast__id_t(struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tLR9Ast__id_t, _fx_free_T2R9Ast__id_tLR9Ast__id_t);
}

static int _fx_cons_LT2R9Ast__id_tLR9Ast__id_t(
   struct _fx_T2R9Ast__id_tLR9Ast__id_t* hd,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tLR9Ast__id_t, _fx_copy_T2R9Ast__id_tLR9Ast__id_t);
}

static void _fx_free_R21K_form__kdefvariant_t(struct _fx_R21K_form__kdefvariant_t* dst)
{
   fx_free_str(&dst->kvar_cname);
   _fx_free_LN14K_form__ktyp_t(&dst->kvar_targs);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->kvar_cases);
   fx_free_list_simple(&dst->kvar_ctors);
   _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&dst->kvar_ifaces);
   fx_free_list_simple(&dst->kvar_scope);
}

static void _fx_copy_R21K_form__kdefvariant_t(
   struct _fx_R21K_form__kdefvariant_t* src,
   struct _fx_R21K_form__kdefvariant_t* dst)
{
   dst->kvar_name = src->kvar_name;
   fx_copy_str(&src->kvar_cname, &dst->kvar_cname);
   dst->kvar_proto = src->kvar_proto;
   dst->kvar_props = src->kvar_props;
   FX_COPY_PTR(src->kvar_targs, &dst->kvar_targs);
   FX_COPY_PTR(src->kvar_cases, &dst->kvar_cases);
   FX_COPY_PTR(src->kvar_ctors, &dst->kvar_ctors);
   dst->kvar_flags = src->kvar_flags;
   FX_COPY_PTR(src->kvar_ifaces, &dst->kvar_ifaces);
   FX_COPY_PTR(src->kvar_scope, &dst->kvar_scope);
   dst->kvar_loc = src->kvar_loc;
}

static void _fx_make_R21K_form__kdefvariant_t(
   struct _fx_R9Ast__id_t* r_kvar_name,
   fx_str_t* r_kvar_cname,
   struct _fx_R9Ast__id_t* r_kvar_proto,
   struct _fx_Nt6option1R17K_form__ktprops_t* r_kvar_props,
   struct _fx_LN14K_form__ktyp_t_data_t* r_kvar_targs,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_kvar_cases,
   struct _fx_LR9Ast__id_t_data_t* r_kvar_ctors,
   struct _fx_R16Ast__var_flags_t* r_kvar_flags,
   struct _fx_LT2R9Ast__id_tLR9Ast__id_t_data_t* r_kvar_ifaces,
   struct _fx_LN12Ast__scope_t_data_t* r_kvar_scope,
   struct _fx_R10Ast__loc_t* r_kvar_loc,
   struct _fx_R21K_form__kdefvariant_t* fx_result)
{
   fx_result->kvar_name = *r_kvar_name;
   fx_copy_str(r_kvar_cname, &fx_result->kvar_cname);
   fx_result->kvar_proto = *r_kvar_proto;
   fx_result->kvar_props = *r_kvar_props;
   FX_COPY_PTR(r_kvar_targs, &fx_result->kvar_targs);
   FX_COPY_PTR(r_kvar_cases, &fx_result->kvar_cases);
   FX_COPY_PTR(r_kvar_ctors, &fx_result->kvar_ctors);
   fx_result->kvar_flags = *r_kvar_flags;
   FX_COPY_PTR(r_kvar_ifaces, &fx_result->kvar_ifaces);
   FX_COPY_PTR(r_kvar_scope, &fx_result->kvar_scope);
   fx_result->kvar_loc = *r_kvar_loc;
}

static void _fx_free_rR21K_form__kdefvariant_t(struct _fx_rR21K_form__kdefvariant_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR21K_form__kdefvariant_t, _fx_free_R21K_form__kdefvariant_t);
}

static int _fx_make_rR21K_form__kdefvariant_t(
   struct _fx_R21K_form__kdefvariant_t* arg,
   struct _fx_rR21K_form__kdefvariant_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR21K_form__kdefvariant_t, _fx_copy_R21K_form__kdefvariant_t);
}

static void _fx_free_R17K_form__kdeftyp_t(struct _fx_R17K_form__kdeftyp_t* dst)
{
   fx_free_str(&dst->kt_cname);
   _fx_free_LN14K_form__ktyp_t(&dst->kt_targs);
   _fx_free_N14K_form__ktyp_t(&dst->kt_typ);
   fx_free_list_simple(&dst->kt_scope);
}

static void _fx_copy_R17K_form__kdeftyp_t(struct _fx_R17K_form__kdeftyp_t* src, struct _fx_R17K_form__kdeftyp_t* dst)
{
   dst->kt_name = src->kt_name;
   fx_copy_str(&src->kt_cname, &dst->kt_cname);
   dst->kt_proto = src->kt_proto;
   dst->kt_props = src->kt_props;
   FX_COPY_PTR(src->kt_targs, &dst->kt_targs);
   FX_COPY_PTR(src->kt_typ, &dst->kt_typ);
   FX_COPY_PTR(src->kt_scope, &dst->kt_scope);
   dst->kt_loc = src->kt_loc;
}

static void _fx_make_R17K_form__kdeftyp_t(
   struct _fx_R9Ast__id_t* r_kt_name,
   fx_str_t* r_kt_cname,
   struct _fx_R9Ast__id_t* r_kt_proto,
   struct _fx_Nt6option1R17K_form__ktprops_t* r_kt_props,
   struct _fx_LN14K_form__ktyp_t_data_t* r_kt_targs,
   struct _fx_N14K_form__ktyp_t_data_t* r_kt_typ,
   struct _fx_LN12Ast__scope_t_data_t* r_kt_scope,
   struct _fx_R10Ast__loc_t* r_kt_loc,
   struct _fx_R17K_form__kdeftyp_t* fx_result)
{
   fx_result->kt_name = *r_kt_name;
   fx_copy_str(r_kt_cname, &fx_result->kt_cname);
   fx_result->kt_proto = *r_kt_proto;
   fx_result->kt_props = *r_kt_props;
   FX_COPY_PTR(r_kt_targs, &fx_result->kt_targs);
   FX_COPY_PTR(r_kt_typ, &fx_result->kt_typ);
   FX_COPY_PTR(r_kt_scope, &fx_result->kt_scope);
   fx_result->kt_loc = *r_kt_loc;
}

static void _fx_free_rR17K_form__kdeftyp_t(struct _fx_rR17K_form__kdeftyp_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17K_form__kdeftyp_t, _fx_free_R17K_form__kdeftyp_t);
}

static int _fx_make_rR17K_form__kdeftyp_t(
   struct _fx_R17K_form__kdeftyp_t* arg,
   struct _fx_rR17K_form__kdeftyp_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17K_form__kdeftyp_t, _fx_copy_R17K_form__kdeftyp_t);
}

static void _fx_free_R25K_form__kdefclosurevars_t(struct _fx_R25K_form__kdefclosurevars_t* dst)
{
   fx_free_str(&dst->kcv_cname);
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->kcv_freevars);
   fx_free_list_simple(&dst->kcv_orig_freevars);
   fx_free_list_simple(&dst->kcv_scope);
}

static void _fx_copy_R25K_form__kdefclosurevars_t(
   struct _fx_R25K_form__kdefclosurevars_t* src,
   struct _fx_R25K_form__kdefclosurevars_t* dst)
{
   dst->kcv_name = src->kcv_name;
   fx_copy_str(&src->kcv_cname, &dst->kcv_cname);
   FX_COPY_PTR(src->kcv_freevars, &dst->kcv_freevars);
   FX_COPY_PTR(src->kcv_orig_freevars, &dst->kcv_orig_freevars);
   FX_COPY_PTR(src->kcv_scope, &dst->kcv_scope);
   dst->kcv_loc = src->kcv_loc;
}

static void _fx_make_R25K_form__kdefclosurevars_t(
   struct _fx_R9Ast__id_t* r_kcv_name,
   fx_str_t* r_kcv_cname,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* r_kcv_freevars,
   struct _fx_LR9Ast__id_t_data_t* r_kcv_orig_freevars,
   struct _fx_LN12Ast__scope_t_data_t* r_kcv_scope,
   struct _fx_R10Ast__loc_t* r_kcv_loc,
   struct _fx_R25K_form__kdefclosurevars_t* fx_result)
{
   fx_result->kcv_name = *r_kcv_name;
   fx_copy_str(r_kcv_cname, &fx_result->kcv_cname);
   FX_COPY_PTR(r_kcv_freevars, &fx_result->kcv_freevars);
   FX_COPY_PTR(r_kcv_orig_freevars, &fx_result->kcv_orig_freevars);
   FX_COPY_PTR(r_kcv_scope, &fx_result->kcv_scope);
   fx_result->kcv_loc = *r_kcv_loc;
}

static void _fx_free_rR25K_form__kdefclosurevars_t(struct _fx_rR25K_form__kdefclosurevars_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR25K_form__kdefclosurevars_t, _fx_free_R25K_form__kdefclosurevars_t);
}

static int _fx_make_rR25K_form__kdefclosurevars_t(
   struct _fx_R25K_form__kdefclosurevars_t* arg,
   struct _fx_rR25K_form__kdefclosurevars_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR25K_form__kdefclosurevars_t, _fx_copy_R25K_form__kdefclosurevars_t);
}

static void _fx_free_N15K_form__kinfo_t(struct _fx_N15K_form__kinfo_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R17K_form__kdefval_t(&dst->u.KVal); break;
   case 3:
      _fx_free_rR17K_form__kdeffun_t(&dst->u.KFun); break;
   case 4:
      _fx_free_rR17K_form__kdefexn_t(&dst->u.KExn); break;
   case 5:
      _fx_free_rR21K_form__kdefvariant_t(&dst->u.KVariant); break;
   case 6:
      _fx_free_rR25K_form__kdefclosurevars_t(&dst->u.KClosureVars); break;
   case 7:
      _fx_free_rR23K_form__kdefinterface_t(&dst->u.KInterface); break;
   case 8:
      _fx_free_rR17K_form__kdeftyp_t(&dst->u.KTyp); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N15K_form__kinfo_t(struct _fx_N15K_form__kinfo_t* src, struct _fx_N15K_form__kinfo_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R17K_form__kdefval_t(&src->u.KVal, &dst->u.KVal); break;
   case 3:
      FX_COPY_PTR(src->u.KFun, &dst->u.KFun); break;
   case 4:
      FX_COPY_PTR(src->u.KExn, &dst->u.KExn); break;
   case 5:
      FX_COPY_PTR(src->u.KVariant, &dst->u.KVariant); break;
   case 6:
      FX_COPY_PTR(src->u.KClosureVars, &dst->u.KClosureVars); break;
   case 7:
      FX_COPY_PTR(src->u.KInterface, &dst->u.KInterface); break;
   case 8:
      FX_COPY_PTR(src->u.KTyp, &dst->u.KTyp); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t(struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t* dst)
{
   fx_free_arr(&dst->t1);
   _fx_free_N15K_form__kinfo_t(&dst->t2);
}

static void _fx_copy_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t(
   struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t* src,
   struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_arr(&src->t1, &dst->t1);
   _fx_copy_N15K_form__kinfo_t(&src->t2, &dst->t2);
}

static void _fx_make_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t(
   int_ t0,
   fx_arr_t* t1,
   struct _fx_N15K_form__kinfo_t* t2,
   struct _fx_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t* fx_result)
{
   fx_result->t0 = t0;
   fx_copy_arr(t1, &fx_result->t1);
   _fx_copy_N15K_form__kinfo_t(t2, &fx_result->t2);
}

static void _fx_free_Nt9Dynvec__t1N15K_form__kinfo_t(struct _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T3iA1N15K_form__kinfo_tN15K_form__kinfo_t(&(*dst)->u.t); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1N10Ast__exp_t(struct _fx_Nt6option1N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_N10Ast__exp_t(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
   struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t* dst)
{
   fx_free_arr(&dst->t4);
   fx_free_arr(&dst->t5);
}

static void _fx_copy_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
   struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t* src,
   struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   fx_copy_arr(&src->t4, &dst->t4);
   fx_copy_arr(&src->t5, &dst->t5);
}

static void _fx_make_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
   struct _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* t0,
   int_ t1,
   int_ t2,
   int_ t3,
   fx_arr_t* t4,
   fx_arr_t* t5,
   struct _fx_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   fx_copy_arr(t4, &fx_result->t4);
   fx_copy_arr(t5, &fx_result->t5);
}

static void _fx_free_Nt10Hashset__t1R9Ast__id_t(struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(&(*dst)->u.t);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_R13Ast__defval_t(struct _fx_R13Ast__defval_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dv_typ);
   _fx_free_R16Ast__val_flags_t(&dst->dv_flags);
   fx_free_list_simple(&dst->dv_scope);
}

static void _fx_copy_R13Ast__defval_t(struct _fx_R13Ast__defval_t* src, struct _fx_R13Ast__defval_t* dst)
{
   dst->dv_name = src->dv_name;
   FX_COPY_PTR(src->dv_typ, &dst->dv_typ);
   _fx_copy_R16Ast__val_flags_t(&src->dv_flags, &dst->dv_flags);
   FX_COPY_PTR(src->dv_scope, &dst->dv_scope);
   dst->dv_loc = src->dv_loc;
}

static void _fx_make_R13Ast__defval_t(
   struct _fx_R9Ast__id_t* r_dv_name,
   struct _fx_N10Ast__typ_t_data_t* r_dv_typ,
   struct _fx_R16Ast__val_flags_t* r_dv_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_dv_scope,
   struct _fx_R10Ast__loc_t* r_dv_loc,
   struct _fx_R13Ast__defval_t* fx_result)
{
   fx_result->dv_name = *r_dv_name;
   FX_COPY_PTR(r_dv_typ, &fx_result->dv_typ);
   _fx_copy_R16Ast__val_flags_t(r_dv_flags, &fx_result->dv_flags);
   FX_COPY_PTR(r_dv_scope, &fx_result->dv_scope);
   fx_result->dv_loc = *r_dv_loc;
}

static void _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->root);
   fx_free_fp(&dst->cmp);
}

static void _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* src,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* dst)
{
   FX_COPY_PTR(src->root, &dst->root);
   FX_COPY_FP(&src->cmp, &dst->cmp);
}

static void _fx_make_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* r_root,
   struct _fx_FPi2R9Ast__id_tR9Ast__id_t* r_cmp,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* fx_result)
{
   FX_COPY_PTR(r_root, &fx_result->root);
   FX_COPY_FP(r_cmp, &fx_result->cmp);
}

static void _fx_free_LN10Ast__pat_t(struct _fx_LN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__pat_t, _fx_free_N10Ast__pat_t);
}

static int _fx_cons_LN10Ast__pat_t(
   struct _fx_N10Ast__pat_t_data_t* hd,
   struct _fx_LN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__pat_t, FX_COPY_PTR);
}

static void _fx_free_rLR9Ast__id_t(struct _fx_rLR9Ast__id_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rLR9Ast__id_t, fx_free_list_simple);
}

static int _fx_make_rLR9Ast__id_t(struct _fx_LR9Ast__id_t_data_t* arg, struct _fx_rLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rLR9Ast__id_t, FX_COPY_PTR);
}

static void _fx_free_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* dst)
{
   fx_free_list_simple(&dst->df_templ_args);
   _fx_free_LN10Ast__pat_t(&dst->df_args);
   _fx_free_N10Ast__typ_t(&dst->df_typ);
   _fx_free_N10Ast__exp_t(&dst->df_body);
   fx_free_list_simple(&dst->df_scope);
   _fx_free_rLR9Ast__id_t(&dst->df_templ_inst);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->df_env);
}

static void _fx_copy_R13Ast__deffun_t(struct _fx_R13Ast__deffun_t* src, struct _fx_R13Ast__deffun_t* dst)
{
   dst->df_name = src->df_name;
   FX_COPY_PTR(src->df_templ_args, &dst->df_templ_args);
   FX_COPY_PTR(src->df_args, &dst->df_args);
   FX_COPY_PTR(src->df_typ, &dst->df_typ);
   FX_COPY_PTR(src->df_body, &dst->df_body);
   dst->df_flags = src->df_flags;
   FX_COPY_PTR(src->df_scope, &dst->df_scope);
   dst->df_loc = src->df_loc;
   FX_COPY_PTR(src->df_templ_inst, &dst->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->df_env, &dst->df_env);
}

static void _fx_make_R13Ast__deffun_t(
   struct _fx_R9Ast__id_t* r_df_name,
   struct _fx_LR9Ast__id_t_data_t* r_df_templ_args,
   struct _fx_LN10Ast__pat_t_data_t* r_df_args,
   struct _fx_N10Ast__typ_t_data_t* r_df_typ,
   struct _fx_N10Ast__exp_t_data_t* r_df_body,
   struct _fx_R16Ast__fun_flags_t* r_df_flags,
   struct _fx_LN12Ast__scope_t_data_t* r_df_scope,
   struct _fx_R10Ast__loc_t* r_df_loc,
   struct _fx_rLR9Ast__id_t_data_t* r_df_templ_inst,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* r_df_env,
   struct _fx_R13Ast__deffun_t* fx_result)
{
   fx_result->df_name = *r_df_name;
   FX_COPY_PTR(r_df_templ_args, &fx_result->df_templ_args);
   FX_COPY_PTR(r_df_args, &fx_result->df_args);
   FX_COPY_PTR(r_df_typ, &fx_result->df_typ);
   FX_COPY_PTR(r_df_body, &fx_result->df_body);
   fx_result->df_flags = *r_df_flags;
   FX_COPY_PTR(r_df_scope, &fx_result->df_scope);
   fx_result->df_loc = *r_df_loc;
   FX_COPY_PTR(r_df_templ_inst, &fx_result->df_templ_inst);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(r_df_env, &fx_result->df_env);
}

static void _fx_free_rR13Ast__deffun_t(struct _fx_rR13Ast__deffun_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_free_R13Ast__deffun_t);
}

static int _fx_make_rR13Ast__deffun_t(struct _fx_R13Ast__deffun_t* arg, struct _fx_rR13Ast__deffun_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deffun_t, _fx_copy_R13Ast__deffun_t);
}

static void _fx_free_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->dexn_typ);
   fx_free_list_simple(&dst->dexn_scope);
}

static void _fx_copy_R13Ast__defexn_t(struct _fx_R13Ast__defexn_t* src, struct _fx_R13Ast__defexn_t* dst)
{
   dst->dexn_name = src->dexn_name;
   FX_COPY_PTR(src->dexn_typ, &dst->dexn_typ);
   FX_COPY_PTR(src->dexn_scope, &dst->dexn_scope);
   dst->dexn_loc = src->dexn_loc;
}

static void _fx_make_R13Ast__defexn_t(
   struct _fx_R9Ast__id_t* r_dexn_name,
   struct _fx_N10Ast__typ_t_data_t* r_dexn_typ,
   struct _fx_LN12Ast__scope_t_data_t* r_dexn_scope,
   struct _fx_R10Ast__loc_t* r_dexn_loc,
   struct _fx_R13Ast__defexn_t* fx_result)
{
   fx_result->dexn_name = *r_dexn_name;
   FX_COPY_PTR(r_dexn_typ, &fx_result->dexn_typ);
   FX_COPY_PTR(r_dexn_scope, &fx_result->dexn_scope);
   fx_result->dexn_loc = *r_dexn_loc;
}

static void _fx_free_rR13Ast__defexn_t(struct _fx_rR13Ast__defexn_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_free_R13Ast__defexn_t);
}

static int _fx_make_rR13Ast__defexn_t(struct _fx_R13Ast__defexn_t* arg, struct _fx_rR13Ast__defexn_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__defexn_t, _fx_copy_R13Ast__defexn_t);
}

static void _fx_free_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* dst)
{
   fx_free_list_simple(&dst->dt_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dt_typ);
   fx_free_list_simple(&dst->dt_scope);
}

static void _fx_copy_R13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* src, struct _fx_R13Ast__deftyp_t* dst)
{
   dst->dt_name = src->dt_name;
   FX_COPY_PTR(src->dt_templ_args, &dst->dt_templ_args);
   FX_COPY_PTR(src->dt_typ, &dst->dt_typ);
   dst->dt_finalized = src->dt_finalized;
   FX_COPY_PTR(src->dt_scope, &dst->dt_scope);
   dst->dt_loc = src->dt_loc;
}

static void _fx_make_R13Ast__deftyp_t(
   struct _fx_R9Ast__id_t* r_dt_name,
   struct _fx_LR9Ast__id_t_data_t* r_dt_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dt_typ,
   bool r_dt_finalized,
   struct _fx_LN12Ast__scope_t_data_t* r_dt_scope,
   struct _fx_R10Ast__loc_t* r_dt_loc,
   struct _fx_R13Ast__deftyp_t* fx_result)
{
   fx_result->dt_name = *r_dt_name;
   FX_COPY_PTR(r_dt_templ_args, &fx_result->dt_templ_args);
   FX_COPY_PTR(r_dt_typ, &fx_result->dt_typ);
   fx_result->dt_finalized = r_dt_finalized;
   FX_COPY_PTR(r_dt_scope, &fx_result->dt_scope);
   fx_result->dt_loc = *r_dt_loc;
}

static void _fx_free_rR13Ast__deftyp_t(struct _fx_rR13Ast__deftyp_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_free_R13Ast__deftyp_t);
}

static int _fx_make_rR13Ast__deftyp_t(struct _fx_R13Ast__deftyp_t* arg, struct _fx_rR13Ast__deftyp_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR13Ast__deftyp_t, _fx_copy_R13Ast__deftyp_t);
}

static void _fx_free_T2R9Ast__id_tN10Ast__typ_t(struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__typ_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__typ_t(struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_free_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__typ_t(
   struct _fx_T2R9Ast__id_tN10Ast__typ_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__typ_t, _fx_copy_T2R9Ast__id_tN10Ast__typ_t);
}

static int _fx_cons_LTa2R9Ast__id_t(
   struct _fx_Ta2R9Ast__id_t* hd,
   struct _fx_LTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LTa2R9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* src,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LTa2R9Ast__id_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_free_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static int _fx_cons_LT2R9Ast__id_tLTa2R9Ast__id_t(
   struct _fx_T2R9Ast__id_tLTa2R9Ast__id_t* hd,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tLTa2R9Ast__id_t, _fx_copy_T2R9Ast__id_tLTa2R9Ast__id_t);
}

static void _fx_free_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* dst)
{
   fx_free_list_simple(&dst->dvar_templ_args);
   _fx_free_N10Ast__typ_t(&dst->dvar_alias);
   _fx_free_LT2R9Ast__id_tN10Ast__typ_t(&dst->dvar_cases);
   fx_free_list_simple(&dst->dvar_ctors);
   _fx_free_rLR9Ast__id_t(&dst->dvar_templ_inst);
   _fx_free_LT2R9Ast__id_tLTa2R9Ast__id_t(&dst->dvar_ifaces);
   fx_free_list_simple(&dst->dvar_scope);
}

static void _fx_copy_R17Ast__defvariant_t(struct _fx_R17Ast__defvariant_t* src, struct _fx_R17Ast__defvariant_t* dst)
{
   dst->dvar_name = src->dvar_name;
   FX_COPY_PTR(src->dvar_templ_args, &dst->dvar_templ_args);
   FX_COPY_PTR(src->dvar_alias, &dst->dvar_alias);
   dst->dvar_flags = src->dvar_flags;
   FX_COPY_PTR(src->dvar_cases, &dst->dvar_cases);
   FX_COPY_PTR(src->dvar_ctors, &dst->dvar_ctors);
   FX_COPY_PTR(src->dvar_templ_inst, &dst->dvar_templ_inst);
   FX_COPY_PTR(src->dvar_ifaces, &dst->dvar_ifaces);
   FX_COPY_PTR(src->dvar_scope, &dst->dvar_scope);
   dst->dvar_loc = src->dvar_loc;
}

static void _fx_make_R17Ast__defvariant_t(
   struct _fx_R9Ast__id_t* r_dvar_name,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_templ_args,
   struct _fx_N10Ast__typ_t_data_t* r_dvar_alias,
   struct _fx_R16Ast__var_flags_t* r_dvar_flags,
   struct _fx_LT2R9Ast__id_tN10Ast__typ_t_data_t* r_dvar_cases,
   struct _fx_LR9Ast__id_t_data_t* r_dvar_ctors,
   struct _fx_rLR9Ast__id_t_data_t* r_dvar_templ_inst,
   struct _fx_LT2R9Ast__id_tLTa2R9Ast__id_t_data_t* r_dvar_ifaces,
   struct _fx_LN12Ast__scope_t_data_t* r_dvar_scope,
   struct _fx_R10Ast__loc_t* r_dvar_loc,
   struct _fx_R17Ast__defvariant_t* fx_result)
{
   fx_result->dvar_name = *r_dvar_name;
   FX_COPY_PTR(r_dvar_templ_args, &fx_result->dvar_templ_args);
   FX_COPY_PTR(r_dvar_alias, &fx_result->dvar_alias);
   fx_result->dvar_flags = *r_dvar_flags;
   FX_COPY_PTR(r_dvar_cases, &fx_result->dvar_cases);
   FX_COPY_PTR(r_dvar_ctors, &fx_result->dvar_ctors);
   FX_COPY_PTR(r_dvar_templ_inst, &fx_result->dvar_templ_inst);
   FX_COPY_PTR(r_dvar_ifaces, &fx_result->dvar_ifaces);
   FX_COPY_PTR(r_dvar_scope, &fx_result->dvar_scope);
   fx_result->dvar_loc = *r_dvar_loc;
}

static void _fx_free_rR17Ast__defvariant_t(struct _fx_rR17Ast__defvariant_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_free_R17Ast__defvariant_t);
}

static int _fx_make_rR17Ast__defvariant_t(
   struct _fx_R17Ast__defvariant_t* arg,
   struct _fx_rR17Ast__defvariant_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR17Ast__defvariant_t, _fx_copy_R17Ast__defvariant_t);
}

static void _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* src,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R16Ast__fun_flags_t* t2,
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_free_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static int _fx_cons_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(
   struct _fx_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t* hd,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t,
      _fx_copy_T3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t);
}

static void _fx_free_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* dst)
{
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_new_methods);
   _fx_free_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t(&dst->di_all_methods);
   fx_free_list_simple(&dst->di_scope);
}

static void _fx_copy_R19Ast__definterface_t(struct _fx_R19Ast__definterface_t* src, struct _fx_R19Ast__definterface_t* dst)
{
   dst->di_name = src->di_name;
   dst->di_base = src->di_base;
   FX_COPY_PTR(src->di_new_methods, &dst->di_new_methods);
   FX_COPY_PTR(src->di_all_methods, &dst->di_all_methods);
   FX_COPY_PTR(src->di_scope, &dst->di_scope);
   dst->di_loc = src->di_loc;
}

static void _fx_make_R19Ast__definterface_t(
   struct _fx_R9Ast__id_t* r_di_name,
   struct _fx_R9Ast__id_t* r_di_base,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_new_methods,
   struct _fx_LT3R9Ast__id_tN10Ast__typ_tR16Ast__fun_flags_t_data_t* r_di_all_methods,
   struct _fx_LN12Ast__scope_t_data_t* r_di_scope,
   struct _fx_R10Ast__loc_t* r_di_loc,
   struct _fx_R19Ast__definterface_t* fx_result)
{
   fx_result->di_name = *r_di_name;
   fx_result->di_base = *r_di_base;
   FX_COPY_PTR(r_di_new_methods, &fx_result->di_new_methods);
   FX_COPY_PTR(r_di_all_methods, &fx_result->di_all_methods);
   FX_COPY_PTR(r_di_scope, &fx_result->di_scope);
   fx_result->di_loc = *r_di_loc;
}

static void _fx_free_rR19Ast__definterface_t(struct _fx_rR19Ast__definterface_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_free_R19Ast__definterface_t);
}

static int _fx_make_rR19Ast__definterface_t(
   struct _fx_R19Ast__definterface_t* arg,
   struct _fx_rR19Ast__definterface_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rR19Ast__definterface_t, _fx_copy_R19Ast__definterface_t);
}

static void _fx_free_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_R13Ast__defval_t(&dst->u.IdDVal); break;
   case 3:
      _fx_free_rR13Ast__deffun_t(&dst->u.IdFun); break;
   case 4:
      _fx_free_rR13Ast__defexn_t(&dst->u.IdExn); break;
   case 5:
      _fx_free_rR13Ast__deftyp_t(&dst->u.IdTyp); break;
   case 6:
      _fx_free_rR17Ast__defvariant_t(&dst->u.IdVariant); break;
   case 7:
      _fx_free_rR19Ast__definterface_t(&dst->u.IdInterface); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14Ast__id_info_t(struct _fx_N14Ast__id_info_t* src, struct _fx_N14Ast__id_info_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_R13Ast__defval_t(&src->u.IdDVal, &dst->u.IdDVal); break;
   case 3:
      FX_COPY_PTR(src->u.IdFun, &dst->u.IdFun); break;
   case 4:
      FX_COPY_PTR(src->u.IdExn, &dst->u.IdExn); break;
   case 5:
      FX_COPY_PTR(src->u.IdTyp, &dst->u.IdTyp); break;
   case 6:
      FX_COPY_PTR(src->u.IdVariant, &dst->u.IdVariant); break;
   case 7:
      FX_COPY_PTR(src->u.IdInterface, &dst->u.IdInterface); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   fx_free_arr(&dst->t1);
   _fx_free_N14Ast__id_info_t(&dst->t2);
}

static void _fx_copy_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* src,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_arr(&src->t1, &dst->t1);
   _fx_copy_N14Ast__id_info_t(&src->t2, &dst->t2);
}

static void _fx_make_T3iA1N14Ast__id_info_tN14Ast__id_info_t(
   int_ t0,
   fx_arr_t* t1,
   struct _fx_N14Ast__id_info_t* t2,
   struct _fx_T3iA1N14Ast__id_info_tN14Ast__id_info_t* fx_result)
{
   fx_result->t0 = t0;
   fx_copy_arr(t1, &fx_result->t1);
   _fx_copy_N14Ast__id_info_t(t2, &fx_result->t2);
}

static void _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T3iA1N14Ast__id_info_tN14Ast__id_info_t(&(*dst)->u.t); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_LN16Ast__env_entry_t(struct _fx_LN16Ast__env_entry_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN16Ast__env_entry_t, _fx_free_N16Ast__env_entry_t);
}

static int _fx_cons_LN16Ast__env_entry_t(
   struct _fx_N16Ast__env_entry_t_data_t* hd,
   struct _fx_LN16Ast__env_entry_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN16Ast__env_entry_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN16Ast__env_entry_t, FX_COPY_PTR);
}

static void
   _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t1);
   _fx_free_LN16Ast__env_entry_t(&dst->t3);
   _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t4);
}

static void
   _fx_copy_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      src,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   FX_COPY_PTR(src->t4, &dst->t4);
}

static void
   _fx_make_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_N12Map__color_t* t0,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t1,
   struct _fx_R9Ast__id_t* t2,
   struct _fx_LN16Ast__env_entry_t_data_t* t3,
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t* t4,
   struct _fx_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t*
      fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   FX_COPY_PTR(t4, &fx_result->t4);
}

static void _fx_free_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
   struct _fx_Nt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T5N12Map__color_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_tR9Ast__id_tLN16Ast__env_entry_tNt11Map__tree_t2R9Ast__id_tLN16Ast__env_entry_t(
         &(*dst)->u.Node);
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* dst)
{
   fx_free_str(&dst->t1);
}

static void _fx_copy_T2R10Ast__loc_tS(struct _fx_T2R10Ast__loc_tS* src, struct _fx_T2R10Ast__loc_tS* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_T2R10Ast__loc_tS(struct _fx_R10Ast__loc_t* t0, fx_str_t* t1, struct _fx_T2R10Ast__loc_tS* fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
}

static void _fx_free_N10Ast__lit_t(struct _fx_N10Ast__lit_t* dst)
{
   switch (dst->tag) {
   case 5:
      fx_free_str(&dst->u.LitString); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N10Ast__lit_t(struct _fx_N10Ast__lit_t* src, struct _fx_N10Ast__lit_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 5:
      fx_copy_str(&src->u.LitString, &dst->u.LitString); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_rNt6option1N10Ast__typ_t(struct _fx_rNt6option1N10Ast__typ_t_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, _fx_free_Nt6option1N10Ast__typ_t);
}

static int _fx_make_rNt6option1N10Ast__typ_t(
   struct _fx_Nt6option1N10Ast__typ_t_data_t* arg,
   struct _fx_rNt6option1N10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rNt6option1N10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_LN10Ast__typ_t(struct _fx_LN10Ast__typ_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__typ_t, _fx_free_N10Ast__typ_t);
}

static int _fx_cons_LN10Ast__typ_t(
   struct _fx_N10Ast__typ_t_data_t* hd,
   struct _fx_LN10Ast__typ_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__typ_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__typ_t, FX_COPY_PTR);
}

static void _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* src,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__typ_tN10Ast__typ_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2LN10Ast__typ_tN10Ast__typ_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T2iN10Ast__typ_t(struct _fx_T2iN10Ast__typ_t* src, struct _fx_T2iN10Ast__typ_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2iN10Ast__typ_t(int_ t0, struct _fx_N10Ast__typ_t_data_t* t1, struct _fx_T2iN10Ast__typ_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_free_R16Ast__val_flags_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t2);
   _fx_free_N10Ast__exp_t(&dst->t3);
}

static void _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* src,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* dst)
{
   _fx_copy_R16Ast__val_flags_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   FX_COPY_PTR(src->t3, &dst->t3);
}

static void _fx_make_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_R16Ast__val_flags_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_N10Ast__typ_t_data_t* t2,
   struct _fx_N10Ast__exp_t_data_t* t3,
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* fx_result)
{
   _fx_copy_R16Ast__val_flags_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   FX_COPY_PTR(t3, &fx_result->t3);
}

static void _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_free_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static int _fx_cons_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(
   struct _fx_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t* hd,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t,
      _fx_copy_T4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t);
}

static void _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   _fx_free_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* src,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_t_data_t* t0,
   bool t1,
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = t1;
}

static void _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** dst)
{
   FX_FREE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_free_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static int _fx_make_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(
   struct _fx_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB* arg,
   struct _fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB_data_t** fx_result)
{
   FX_MAKE_REF_IMPL(_fx_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB,
      _fx_copy_T2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB);
}

static void _fx_free_T2LN10Ast__typ_tR9Ast__id_t(struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   _fx_free_LN10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* src,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__typ_tR9Ast__id_t(
   struct _fx_LN10Ast__typ_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_T2LN10Ast__typ_tR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__typ_t(struct _fx_N10Ast__typ_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 1:
         _fx_free_rNt6option1N10Ast__typ_t(&(*dst)->u.TypVar); break;
      case 2:
         _fx_free_Nt6option1N10Ast__typ_t(&(*dst)->u.TypVarTuple); break;
      case 3:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVarArray); break;
      case 14:
         _fx_free_T2LN10Ast__typ_tN10Ast__typ_t(&(*dst)->u.TypFun); break;
      case 15:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypList); break;
      case 16:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypVector); break;
      case 17:
         _fx_free_LN10Ast__typ_t(&(*dst)->u.TypTuple); break;
      case 18:
         _fx_free_N10Ast__typ_t(&(*dst)->u.TypRef); break;
      case 19:
         _fx_free_T2iN10Ast__typ_t(&(*dst)->u.TypArray); break;
      case 20:
         _fx_free_rT2LT4R16Ast__val_flags_tR9Ast__id_tN10Ast__typ_tN10Ast__exp_tB(&(*dst)->u.TypRecord); break;
      case 24:
         _fx_free_T2LN10Ast__typ_tR9Ast__id_t(&(*dst)->u.TypApp); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N13Ast__binary_t(struct _fx_N13Ast__binary_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 27:
         _fx_free_N13Ast__binary_t(&(*dst)->u.OpAugBinary); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2Nt6option1N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__typ_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__typ_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t0);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t1);
   _fx_free_Nt6option1N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t0,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t1,
   struct _fx_Nt6option1N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_LN10Ast__exp_t(struct _fx_LN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN10Ast__exp_t, _fx_free_N10Ast__exp_t);
}

static int _fx_cons_LN10Ast__exp_t(
   struct _fx_N10Ast__exp_t_data_t* hd,
   struct _fx_LN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2R9Ast__id_tN10Ast__exp_t(struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__exp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LLN10Ast__exp_t(struct _fx_LLN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LLN10Ast__exp_t, _fx_free_LN10Ast__exp_t);
}

static int _fx_cons_LLN10Ast__exp_t(
   struct _fx_LN10Ast__exp_t_data_t* hd,
   struct _fx_LLN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LLN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LLN10Ast__exp_t, FX_COPY_PTR);
}

static void _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LLN10Ast__exp_t(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LLN10Ast__exp_t_data_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__exp_t(struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_free_T2R9Ast__id_tN10Ast__exp_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__exp_t(
   struct _fx_T2R9Ast__id_tN10Ast__exp_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__exp_t, _fx_copy_T2R9Ast__id_tN10Ast__exp_t);
}

static void _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LN10Ast__exp_t(&dst->t3);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t4);
}

static void _fx_copy_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t4, &dst->t4);
}

static void _fx_make_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N13Ast__border_t* t1,
   struct _fx_N18Ast__interpolate_t* t2,
   struct _fx_LN10Ast__exp_t_data_t* t3,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t4,
   struct _fx_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t4, &fx_result->t4);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2N10Ast__exp_tR10Ast__loc_t(struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2N10Ast__pat_tN10Ast__exp_t(struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* src,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_free_T2N10Ast__pat_tN10Ast__exp_t);
}

static int _fx_cons_LT2N10Ast__pat_tN10Ast__exp_t(
   struct _fx_T2N10Ast__pat_tN10Ast__exp_t* hd,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2N10Ast__pat_tN10Ast__exp_t, _fx_copy_T2N10Ast__pat_tN10Ast__exp_t);
}

static void _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
   _fx_free_N10Ast__exp_t(&dst->t2);
}

static void _fx_copy_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_N10Ast__exp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_R10Ast__loc_t* t4,
   struct _fx_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
   fx_result->t4 = *t4;
}

static void _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* src,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_free_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static int _fx_cons_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(
   struct _fx_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t* hd,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t, _fx_copy_T2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t);
}

static void
   _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t3);
}

static void
   _fx_copy_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void
   _fx_make_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t3,
   struct _fx_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t*
      fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_LT2N10Ast__pat_tN10Ast__exp_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_LT2N10Ast__pat_tN10Ast__exp_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__exp_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__exp_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2ST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2ST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t1,
   struct _fx_T2ST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t1);
   _fx_free_T2N10Ast__typ_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3SST2N10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3SST2N10Ast__typ_tR10Ast__loc_t(
   fx_str_t* t0,
   fx_str_t* t1,
   struct _fx_T2N10Ast__typ_tR10Ast__loc_t* t2,
   struct _fx_T3SST2N10Ast__typ_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
   _fx_copy_T2N10Ast__typ_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
   _fx_free_R16Ast__val_flags_t(&dst->t2);
}

static void _fx_copy_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* src,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_R16Ast__val_flags_t(&src->t2, &dst->t2);
   dst->t3 = src->t3;
}

static void _fx_make_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R16Ast__val_flags_t* t2,
   struct _fx_R10Ast__loc_t* t3,
   struct _fx_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_R16Ast__val_flags_t(t2, &fx_result->t2);
   fx_result->t3 = *t3;
}

static int _fx_cons_LT2iR9Ast__id_t(
   struct _fx_T2iR9Ast__id_t* hd,
   struct _fx_LT2iR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2iR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2iR9Ast__id_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t0);
}

static void _fx_copy_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LT2iR9Ast__id_tR10Ast__loc_t(
   struct _fx_LT2iR9Ast__id_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LT2iR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T3iLR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3iLR9Ast__id_tR10Ast__loc_t(
   int_ t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3iLR9Ast__id_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* dst)
{
   _fx_free_LS(&dst->t0);
}

static void _fx_copy_T2LSR10Ast__loc_t(struct _fx_T2LSR10Ast__loc_t* src, struct _fx_T2LSR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LSR10Ast__loc_t(
   struct _fx_LS_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LSR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__exp_t(struct _fx_N10Ast__exp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 4:
         _fx_free_T2Nt6option1N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpReturn); break;
      case 5:
         _fx_free_T4Nt6option1N10Ast__exp_tNt6option1N10Ast__exp_tNt6option1N10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpRange);
         break;
      case 6:
         _fx_free_T2N10Ast__lit_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpLit); break;
      case 7:
         _fx_free_T2R9Ast__id_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIdent); break;
      case 8:
         _fx_free_T4N13Ast__binary_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpBinary); break;
      case 9:
         _fx_free_T3N12Ast__unary_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUnary); break;
      case 10:
         _fx_free_T3N13Ast__intrin_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIntrin); break;
      case 11:
         _fx_free_T2R9Ast__id_tN10Ast__exp_t(&(*dst)->u.ExpSync); break;
      case 12:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpSeq); break;
      case 13:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkTuple); break;
      case 14:
         _fx_free_T2LLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkArray); break;
      case 15:
         _fx_free_T2LN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkVector); break;
      case 16:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMkRecord); break;
      case 17:
         _fx_free_T3N10Ast__exp_tLT2R9Ast__id_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpUpdateRecord); break;
      case 18:
         _fx_free_T3N10Ast__exp_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCall); break;
      case 19:
         _fx_free_T5N10Ast__exp_tN13Ast__border_tN18Ast__interpolate_tLN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpAt);
         break;
      case 20:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpAssign); break;
      case 21:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMem); break;
      case 22:
         _fx_free_T2N10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpThrow); break;
      case 23:
         _fx_free_T4N10Ast__exp_tN10Ast__exp_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpIf); break;
      case 24:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpWhile); break;
      case 25:
         _fx_free_T3N10Ast__exp_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.ExpDoWhile); break;
      case 26:
         _fx_free_T5LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tR10Ast__loc_t(&(*dst)->u.ExpFor);
         break;
      case 27:
         _fx_free_T4LT2LT2N10Ast__pat_tN10Ast__exp_tN10Ast__pat_tN10Ast__exp_tR16Ast__for_flags_tT2N10Ast__typ_tR10Ast__loc_t(
            &(*dst)->u.ExpMap);
         break;
      case 28:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTryCatch); break;
      case 29:
         _fx_free_T3N10Ast__exp_tLT2N10Ast__pat_tN10Ast__exp_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpMatch); break;
      case 30:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCast); break;
      case 31:
         _fx_free_T3N10Ast__exp_tN10Ast__typ_tT2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpTyped); break;
      case 32:
         _fx_free_T2ST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpCCode); break;
      case 33:
         _fx_free_T3SST2N10Ast__typ_tR10Ast__loc_t(&(*dst)->u.ExpData); break;
      case 34:
         _fx_free_T4N10Ast__pat_tN10Ast__exp_tR16Ast__val_flags_tR10Ast__loc_t(&(*dst)->u.DefVal); break;
      case 35:
         _fx_free_rR13Ast__deffun_t(&(*dst)->u.DefFun); break;
      case 36:
         _fx_free_rR13Ast__defexn_t(&(*dst)->u.DefExn); break;
      case 37:
         _fx_free_rR13Ast__deftyp_t(&(*dst)->u.DefTyp); break;
      case 38:
         _fx_free_rR17Ast__defvariant_t(&(*dst)->u.DefVariant); break;
      case 39:
         _fx_free_rR19Ast__definterface_t(&(*dst)->u.DefInterface); break;
      case 40:
         _fx_free_T2LT2iR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImport); break;
      case 41:
         _fx_free_T3iLR9Ast__id_tR10Ast__loc_t(&(*dst)->u.DirImportFrom); break;
      case 42:
         _fx_free_T2LSR10Ast__loc_t(&(*dst)->u.DirPragma); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2N10Ast__lit_tR10Ast__loc_t(struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__lit_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* dst)
{
   _fx_copy_N10Ast__lit_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__lit_tR10Ast__loc_t(
   struct _fx_N10Ast__lit_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__lit_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N10Ast__lit_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2LN10Ast__pat_tR10Ast__loc_t(
   struct _fx_LN10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2LN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2R9Ast__id_tN10Ast__pat_t(struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* src,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN10Ast__pat_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN10Ast__pat_t(struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_free_T2R9Ast__id_tN10Ast__pat_t);
}

static int _fx_cons_LT2R9Ast__id_tN10Ast__pat_t(
   struct _fx_T2R9Ast__id_tN10Ast__pat_t* hd,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN10Ast__pat_t, _fx_copy_T2R9Ast__id_tN10Ast__pat_t);
}

static void _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_LT2R9Ast__id_tN10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_Nt6option1R9Ast__id_t* t0,
   struct _fx_LT2R9Ast__id_tN10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__pat_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__pat_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__typ_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__typ_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
   _fx_free_N10Ast__exp_t(&dst->t1);
}

static void _fx_copy_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* src,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_N10Ast__exp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2N10Ast__pat_tR10Ast__loc_t(struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   _fx_free_N10Ast__pat_t(&dst->t0);
}

static void _fx_copy_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* src,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N10Ast__pat_tR10Ast__loc_t(
   struct _fx_N10Ast__pat_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N10Ast__pat_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_N10Ast__pat_t(struct _fx_N10Ast__pat_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 2:
         _fx_free_T2N10Ast__lit_tR10Ast__loc_t(&(*dst)->u.PatLit); break;
      case 4:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatTuple); break;
      case 5:
         _fx_free_T3R9Ast__id_tLN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatVariant); break;
      case 6:
         _fx_free_T3Nt6option1R9Ast__id_tLT2R9Ast__id_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRecord); break;
      case 7:
         _fx_free_T3N10Ast__pat_tN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatCons); break;
      case 8:
         _fx_free_T3N10Ast__pat_tR9Ast__id_tR10Ast__loc_t(&(*dst)->u.PatAs); break;
      case 9:
         _fx_free_T3N10Ast__pat_tN10Ast__typ_tR10Ast__loc_t(&(*dst)->u.PatTyped); break;
      case 10:
         _fx_free_T3N10Ast__pat_tN10Ast__exp_tR10Ast__loc_t(&(*dst)->u.PatWhen); break;
      case 11:
         _fx_free_T2LN10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatAlt); break;
      case 12:
         _fx_free_T2N10Ast__pat_tR10Ast__loc_t(&(*dst)->u.PatRef); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_N16Ast__env_entry_t(struct _fx_N16Ast__env_entry_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) { case 2:     _fx_free_N10Ast__typ_t(&(*dst)->u.EnvTyp); break; default:    ; } fx_free(*dst);
   }
   *dst = 0;
}

static int _fx_cons_Li(int_ hd, struct _fx_Li_data_t* tl, bool addref_tl, struct _fx_Li_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_Li, FX_COPY_SIMPLE);
}

static void _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   fx_free_str(&dst->t1);
   _fx_free_LN10Ast__exp_t(&dst->t4);
   fx_free_list_simple(&dst->t5);
   _fx_free_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&dst->t6);
   _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(&dst->t9);
}

static void _fx_copy_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* src,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t* dst)
{
   dst->t0 = src->t0;
   fx_copy_str(&src->t1, &dst->t1);
   dst->t2 = src->t2;
   dst->t3 = src->t3;
   FX_COPY_PTR(src->t4, &dst->t4);
   FX_COPY_PTR(src->t5, &dst->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(&src->t6, &dst->t6);
   dst->t7 = src->t7;
   dst->t8 = src->t8;
   FX_COPY_PTR(src->t9, &dst->t9);
}

static void _fx_make_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
   struct _fx_R9Ast__id_t* t0,
   fx_str_t* t1,
   int_ t2,
   bool t3,
   struct _fx_LN10Ast__exp_t_data_t* t4,
   struct _fx_Li_data_t* t5,
   struct _fx_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t* t6,
   bool t7,
   int_ t8,
   struct _fx_Nt9Dynvec__t1N14Ast__id_info_t_data_t* t9,
   struct _fx_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t*
      fx_result)
{
   fx_result->t0 = *t0;
   fx_copy_str(t1, &fx_result->t1);
   fx_result->t2 = t2;
   fx_result->t3 = t3;
   FX_COPY_PTR(t4, &fx_result->t4);
   FX_COPY_PTR(t5, &fx_result->t5);
   _fx_copy_Rt6Map__t2R9Ast__id_tLN16Ast__env_entry_t(t6, &fx_result->t6);
   fx_result->t7 = t7;
   fx_result->t8 = t8;
   FX_COPY_PTR(t9, &fx_result->t9);
}

static void _fx_free_N16Ast__defmodule_t(struct _fx_N16Ast__defmodule_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      _fx_free_T10R9Ast__id_tSiBLN10Ast__exp_tLiRt6Map__t2R9Ast__id_tLN16Ast__env_entry_tBiNt9Dynvec__t1N14Ast__id_info_t(
         &(*dst)->u.defmodule_t);
      fx_free(*dst);
   }
   *dst = 0;
}

static int _fx_cons_LR10Ast__loc_t(
   struct _fx_R10Ast__loc_t* hd,
   struct _fx_LR10Ast__loc_t_data_t* tl,
   bool addref_tl,
   struct _fx_LR10Ast__loc_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LR10Ast__loc_t, FX_COPY_SIMPLE_BY_PTR);
}

static void _fx_free_Nt6option1N14K_form__kexp_t(struct _fx_Nt6option1N14K_form__kexp_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__kexp_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1N14K_form__kexp_t(
   struct _fx_Nt6option1N14K_form__kexp_t* src,
   struct _fx_Nt6option1N14K_form__kexp_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      FX_COPY_PTR(src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_Nt6option1rR23K_form__kdefinterface_t(struct _fx_Nt6option1rR23K_form__kdefinterface_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_rR23K_form__kdefinterface_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1rR23K_form__kdefinterface_t(
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* src,
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      FX_COPY_PTR(src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_N14K_form__klit_t(struct _fx_N14K_form__klit_t* dst)
{
   switch (dst->tag) {
   case 5:
      fx_free_str(&dst->u.KLitString); break;
   case 8:
      _fx_free_N14K_form__ktyp_t(&dst->u.KLitNil); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14K_form__klit_t(struct _fx_N14K_form__klit_t* src, struct _fx_N14K_form__klit_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 5:
      fx_copy_str(&src->u.KLitString, &dst->u.KLitString); break;
   case 8:
      FX_COPY_PTR(src->u.KLitNil, &dst->u.KLitNil); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_N14K_form__atom_t(struct _fx_N14K_form__atom_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__klit_t(&dst->u.AtomLit); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N14K_form__atom_t(struct _fx_N14K_form__atom_t* src, struct _fx_N14K_form__atom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_N14K_form__klit_t(&src->u.AtomLit, &dst->u.AtomLit); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_R22K_form__k_fold_callb_t(struct _fx_R22K_form__k_fold_callb_t* dst)
{
   _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(&dst->kcb_fold_ktyp);
   _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(&dst->kcb_fold_kexp);
   _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&dst->kcb_fold_atom);
}

static void _fx_copy_R22K_form__k_fold_callb_t(
   struct _fx_R22K_form__k_fold_callb_t* src,
   struct _fx_R22K_form__k_fold_callb_t* dst)
{
   FX_COPY_PTR(src->kcb_fold_ktyp, &dst->kcb_fold_ktyp);
   FX_COPY_PTR(src->kcb_fold_kexp, &dst->kcb_fold_kexp);
   FX_COPY_PTR(src->kcb_fold_atom, &dst->kcb_fold_atom);
}

static void _fx_make_R22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t* r_kcb_fold_ktyp,
   struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t* r_kcb_fold_kexp,
   struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t* r_kcb_fold_atom,
   struct _fx_R22K_form__k_fold_callb_t* fx_result)
{
   FX_COPY_PTR(r_kcb_fold_ktyp, &fx_result->kcb_fold_ktyp);
   FX_COPY_PTR(r_kcb_fold_kexp, &fx_result->kcb_fold_kexp);
   FX_COPY_PTR(r_kcb_fold_atom, &fx_result->kcb_fold_atom);
}

static void _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(
   struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_R17K_form__k_callb_t(struct _fx_R17K_form__k_callb_t* dst)
{
   _fx_free_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t(&dst->kcb_ktyp);
   _fx_free_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t(&dst->kcb_kexp);
   _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&dst->kcb_atom);
}

static void _fx_copy_R17K_form__k_callb_t(struct _fx_R17K_form__k_callb_t* src, struct _fx_R17K_form__k_callb_t* dst)
{
   FX_COPY_PTR(src->kcb_ktyp, &dst->kcb_ktyp);
   FX_COPY_PTR(src->kcb_kexp, &dst->kcb_kexp);
   FX_COPY_PTR(src->kcb_atom, &dst->kcb_atom);
}

static void _fx_make_R17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t* r_kcb_ktyp,
   struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t* r_kcb_kexp,
   struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t* r_kcb_atom,
   struct _fx_R17K_form__k_callb_t* fx_result)
{
   FX_COPY_PTR(r_kcb_ktyp, &fx_result->kcb_ktyp);
   FX_COPY_PTR(r_kcb_kexp, &fx_result->kcb_kexp);
   FX_COPY_PTR(r_kcb_atom, &fx_result->kcb_atom);
}

static void _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t(
   struct _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      fx_free_fp(&(*dst)->u.Some); fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Nt6option1N14K_form__atom_t(struct _fx_Nt6option1N14K_form__atom_t* dst)
{
   switch (dst->tag) {
   case 2:
      _fx_free_N14K_form__atom_t(&dst->u.Some); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_Nt6option1N14K_form__atom_t(
   struct _fx_Nt6option1N14K_form__atom_t* src,
   struct _fx_Nt6option1N14K_form__atom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 2:
      _fx_copy_N14K_form__atom_t(&src->u.Some, &dst->u.Some); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_LN14K_form__kexp_t(struct _fx_LN14K_form__kexp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__kexp_t, _fx_free_N14K_form__kexp_t);
}

static int _fx_cons_LN14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* hd,
   struct _fx_LN14K_form__kexp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__kexp_t, FX_COPY_PTR);
}

static void _fx_free_T2BN14K_form__atom_t(struct _fx_T2BN14K_form__atom_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
}

static void _fx_copy_T2BN14K_form__atom_t(struct _fx_T2BN14K_form__atom_t* src, struct _fx_T2BN14K_form__atom_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
}

static void _fx_make_T2BN14K_form__atom_t(bool t0, struct _fx_N14K_form__atom_t* t1, struct _fx_T2BN14K_form__atom_t* fx_result)
{
   fx_result->t0 = t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
}

static void _fx_free_LT2BN14K_form__atom_t(struct _fx_LT2BN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2BN14K_form__atom_t, _fx_free_T2BN14K_form__atom_t);
}

static int _fx_cons_LT2BN14K_form__atom_t(
   struct _fx_T2BN14K_form__atom_t* hd,
   struct _fx_LT2BN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2BN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2BN14K_form__atom_t, _fx_copy_T2BN14K_form__atom_t);
}

static void _fx_free_T2LN14K_form__ktyp_tN14K_form__ktyp_t(struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* dst)
{
   _fx_free_LN14K_form__ktyp_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* src,
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* src,
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2iN14K_form__ktyp_t(struct _fx_T2iN14K_form__ktyp_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T2iN14K_form__ktyp_t(struct _fx_T2iN14K_form__ktyp_t* src, struct _fx_T2iN14K_form__ktyp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2iN14K_form__ktyp_t(
   int_ t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_T2iN14K_form__ktyp_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_N14K_form__ktyp_t(struct _fx_N14K_form__ktyp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 12:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypRawPointer); break;
      case 13:
         _fx_free_T2LN14K_form__ktyp_tN14K_form__ktyp_t(&(*dst)->u.KTypFun); break;
      case 14:
         _fx_free_LN14K_form__ktyp_t(&(*dst)->u.KTypTuple); break;
      case 15:
         _fx_free_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(&(*dst)->u.KTypRecord); break;
      case 17:
         _fx_free_T2iN14K_form__ktyp_t(&(*dst)->u.KTypArray); break;
      case 18:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypVector); break;
      case 19:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypList); break;
      case 20:
         _fx_free_N14K_form__ktyp_t(&(*dst)->u.KTypRef); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_Ta3N14K_form__atom_t(struct _fx_Ta3N14K_form__atom_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_N14K_form__atom_t(&dst->t2);
}

static void _fx_copy_Ta3N14K_form__atom_t(struct _fx_Ta3N14K_form__atom_t* src, struct _fx_Ta3N14K_form__atom_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_N14K_form__atom_t(&src->t2, &dst->t2);
}

static void _fx_make_Ta3N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_N14K_form__atom_t* t2,
   struct _fx_Ta3N14K_form__atom_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_N14K_form__atom_t(t2, &fx_result->t2);
}

static void _fx_free_N13K_form__dom_t(struct _fx_N13K_form__dom_t* dst)
{
   switch (dst->tag) {
   case 1:
      _fx_free_N14K_form__atom_t(&dst->u.DomainElem); break;
   case 2:
      _fx_free_N14K_form__atom_t(&dst->u.DomainFast); break;
   case 3:
      _fx_free_Ta3N14K_form__atom_t(&dst->u.DomainRange); break;
   default:
      ;
   }
   dst->tag = 0;
}

static void _fx_copy_N13K_form__dom_t(struct _fx_N13K_form__dom_t* src, struct _fx_N13K_form__dom_t* dst)
{
   dst->tag = src->tag;
   switch (src->tag) {
   case 1:
      _fx_copy_N14K_form__atom_t(&src->u.DomainElem, &dst->u.DomainElem); break;
   case 2:
      _fx_copy_N14K_form__atom_t(&src->u.DomainFast, &dst->u.DomainFast); break;
   case 3:
      _fx_copy_Ta3N14K_form__atom_t(&src->u.DomainRange, &dst->u.DomainRange); break;
   default:
      dst->u = src->u;
   }
}

static void _fx_free_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_free_Nt6option1N14K_form__atom_t(&dst->t0);
}

static void _fx_copy_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* src,
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_copy_Nt6option1N14K_form__atom_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_Nt6option1N14K_form__atom_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* fx_result)
{
   _fx_copy_Nt6option1N14K_form__atom_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__ktyp_t(&dst->t0);
}

static void _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   dst->t1 = src->t1;
}

static void _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t0,
   struct _fx_R10Ast__loc_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   fx_result->t1 = *t1;
}

static void _fx_free_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N13Ast__binary_t(&dst->t0);
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_N14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_N14K_form__atom_t(&src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_N14K_form__atom_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_N14K_form__atom_t(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_LN14K_form__atom_t(struct _fx_LN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN14K_form__atom_t, _fx_free_N14K_form__atom_t);
}

static int _fx_cons_LN14K_form__atom_t(
   struct _fx_N14K_form__atom_t* hd,
   struct _fx_LN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN14K_form__atom_t, _fx_copy_N14K_form__atom_t);
}

static void _fx_free_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* t0,
   struct _fx_LN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2R9Ast__id_tN14K_form__kexp_t(struct _fx_T2R9Ast__id_tN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* src,
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tN14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_N14K_form__kexp_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_N14K_form__kexp_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_LN14K_form__atom_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LN14K_form__atom_t(&dst->t2);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void _fx_copy_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   FX_COPY_PTR(src->t2, &dst->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void _fx_make_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_R9Ast__id_t* t1,
   struct _fx_LN14K_form__atom_t_data_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = *t1;
   FX_COPY_PTR(t2, &fx_result->t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_LLT2BN14K_form__atom_t(struct _fx_LLT2BN14K_form__atom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LLT2BN14K_form__atom_t, _fx_free_LT2BN14K_form__atom_t);
}

static int _fx_cons_LLT2BN14K_form__atom_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* hd,
   struct _fx_LLT2BN14K_form__atom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LLT2BN14K_form__atom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LLT2BN14K_form__atom_t, FX_COPY_PTR);
}

static void _fx_free_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LLT2BN14K_form__atom_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   bool t0,
   struct _fx_LLT2BN14K_form__atom_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2BN14K_form__atom_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_LN13K_form__dom_t(struct _fx_LN13K_form__dom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LN13K_form__dom_t, _fx_free_N13K_form__dom_t);
}

static int _fx_cons_LN13K_form__dom_t(
   struct _fx_N13K_form__dom_t* hd,
   struct _fx_LN13K_form__dom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LN13K_form__dom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LN13K_form__dom_t, _fx_copy_N13K_form__dom_t);
}

static void _fx_free_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_LN13K_form__dom_t(&dst->t3);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t4);
}

static void _fx_copy_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   dst->t1 = src->t1;
   dst->t2 = src->t2;
   FX_COPY_PTR(src->t3, &dst->t3);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t4, &dst->t4);
}

static void _fx_make_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N13Ast__border_t* t1,
   struct _fx_N18Ast__interpolate_t* t2,
   struct _fx_LN13K_form__dom_t_data_t* t3,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t4,
   struct _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t*
      fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   fx_result->t1 = *t1;
   fx_result->t2 = *t2;
   FX_COPY_PTR(t3, &fx_result->t3);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t4, &fx_result->t4);
}

static void _fx_free_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   dst->t1 = src->t1;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   int_ t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   fx_result->t1 = t1;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N14K_form__atom_t(&src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__atom_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N14K_form__atom_t(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* src,
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t, _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t);
}

static int _fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(
   struct _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* hd,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2LN14K_form__kexp_tN14K_form__kexp_t, _fx_copy_T2LN14K_form__kexp_tN14K_form__kexp_t);
}

static void _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t2);
}

static void _fx_copy_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t2, &dst->t2);
}

static void _fx_make_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t2,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t2, &fx_result->t2);
}

static void _fx_free_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_N14K_form__ktyp_t(&dst->t1);
}

static void _fx_copy_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_N14K_form__ktyp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2R9Ast__id_tN13K_form__dom_t(struct _fx_T2R9Ast__id_tN13K_form__dom_t* dst)
{
   _fx_free_N13K_form__dom_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tN13K_form__dom_t(
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* src,
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* dst)
{
   dst->t0 = src->t0;
   _fx_copy_N13K_form__dom_t(&src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tN13K_form__dom_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N13K_form__dom_t* t1,
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* fx_result)
{
   fx_result->t0 = *t0;
   _fx_copy_N13K_form__dom_t(t1, &fx_result->t1);
}

static void _fx_free_LT2R9Ast__id_tN13K_form__dom_t(struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT2R9Ast__id_tN13K_form__dom_t, _fx_free_T2R9Ast__id_tN13K_form__dom_t);
}

static int _fx_cons_LT2R9Ast__id_tN13K_form__dom_t(
   struct _fx_T2R9Ast__id_tN13K_form__dom_t* hd,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT2R9Ast__id_tN13K_form__dom_t, _fx_copy_T2R9Ast__id_tN13K_form__dom_t);
}

static void _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t1);
   fx_free_list_simple(&dst->t2);
}

static void _fx_copy_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* src,
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
}

static void _fx_make_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t1,
   struct _fx_LR9Ast__id_t_data_t* t2,
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
}

static void _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t** dst)
{
   FX_FREE_LIST_IMPL(_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t,
      _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t);
}

static int _fx_cons_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(
   struct _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* hd,
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* tl,
   bool addref_tl,
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_LIST_IMPL(_fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t,
      _fx_copy_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t);
}

static void
   _fx_free_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      dst)
{
   _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t3);
}

static void
   _fx_copy_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      src,
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t3, &dst->t3);
}

static void
   _fx_make_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R16Ast__for_flags_t* t2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t3,
   struct _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
      fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t3, &fx_result->t3);
}

static void _fx_free_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
   _fx_free_N14K_form__kexp_t(&dst->t2);
}

static void _fx_copy_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* src,
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   FX_COPY_PTR(src->t2, &dst->t2);
   dst->t3 = src->t3;
   dst->t4 = src->t4;
}

static void _fx_make_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_N14K_form__kexp_t_data_t* t2,
   struct _fx_R16Ast__for_flags_t* t3,
   struct _fx_R10Ast__loc_t* t4,
   struct _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   FX_COPY_PTR(t2, &fx_result->t2);
   fx_result->t3 = *t3;
   fx_result->t4 = *t4;
}

static void _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t0);
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* src,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_T2ST2N14K_form__ktyp_tR10Ast__loc_t(struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   fx_free_str(&dst->t0);
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&dst->t1);
}

static void _fx_copy_T2ST2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* src,
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&src->t1, &dst->t1);
}

static void _fx_make_T2ST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* t0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* t1,
   struct _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(t1, &fx_result->t1);
}

static void _fx_free_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   _fx_free_N14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* src,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
   dst->t2 = src->t2;
}

static void _fx_make_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_N14K_form__kexp_t_data_t* t1,
   struct _fx_R10Ast__loc_t* t2,
   struct _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
   fx_result->t2 = *t2;
}

static void _fx_free_N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t** dst)
{
   if (*dst && FX_DECREF((*dst)->rc) == 1) {
      switch ((*dst)->tag) {
      case 4:
         _fx_free_T2Nt6option1N14K_form__atom_tR10Ast__loc_t(&(*dst)->u.KExpReturn); break;
      case 5:
         _fx_free_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpAtom); break;
      case 6:
         _fx_free_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpBinary);
         break;
      case 7:
         _fx_free_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpUnary); break;
      case 8:
         _fx_free_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpIntrin); break;
      case 9:
         _fx_free_T2R9Ast__id_tN14K_form__kexp_t(&(*dst)->u.KExpSync); break;
      case 10:
         _fx_free_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpSeq); break;
      case 11:
         _fx_free_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpIf);
         break;
      case 12:
         _fx_free_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCall); break;
      case 13:
         _fx_free_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpICall); break;
      case 14:
         _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkTuple); break;
      case 15:
         _fx_free_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkRecord); break;
      case 16:
         _fx_free_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkClosure); break;
      case 17:
         _fx_free_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkArray); break;
      case 18:
         _fx_free_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMkVector); break;
      case 19:
         _fx_free_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &(*dst)->u.KExpAt);
         break;
      case 20:
         _fx_free_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMem); break;
      case 21:
         _fx_free_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(&(*dst)->u.KExpAssign); break;
      case 22:
         _fx_free_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpMatch); break;
      case 23:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpTryCatch); break;
      case 25:
         _fx_free_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCast); break;
      case 26:
         _fx_free_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &(*dst)->u.KExpMap);
         break;
      case 27:
         _fx_free_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
            &(*dst)->u.KExpFor);
         break;
      case 28:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KExpWhile); break;
      case 29:
         _fx_free_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KExpDoWhile); break;
      case 30:
         _fx_free_T2ST2N14K_form__ktyp_tR10Ast__loc_t(&(*dst)->u.KExpCCode); break;
      case 31:
         _fx_free_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(&(*dst)->u.KDefVal); break;
      case 32:
         _fx_free_rR17K_form__kdeffun_t(&(*dst)->u.KDefFun); break;
      case 33:
         _fx_free_rR17K_form__kdefexn_t(&(*dst)->u.KDefExn); break;
      case 34:
         _fx_free_rR21K_form__kdefvariant_t(&(*dst)->u.KDefVariant); break;
      case 35:
         _fx_free_rR23K_form__kdefinterface_t(&(*dst)->u.KDefInterface); break;
      case 36:
         _fx_free_rR17K_form__kdeftyp_t(&(*dst)->u.KDefTyp); break;
      case 37:
         _fx_free_rR25K_form__kdefclosurevars_t(&(*dst)->u.KDefClosureVars); break;
      default:
         ;
      }
      fx_free(*dst);
   }
   *dst = 0;
}

static void _fx_free_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t(
   struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t* dst)
{
   _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&dst->t0);
   fx_free_list_simple(&dst->t1);
}

static void _fx_copy_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t(
   struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t* src,
   struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t* dst)
{
   FX_COPY_PTR(src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t(
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* t0,
   struct _fx_LR9Ast__id_t_data_t* t1,
   struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t* fx_result)
{
   FX_COPY_PTR(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_free_N14K_form__atom_t(&dst->t0);
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* src,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* dst)
{
   _fx_copy_N14K_form__atom_t(&src->t0, &dst->t0);
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(
   struct _fx_N14K_form__atom_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result)
{
   _fx_copy_N14K_form__atom_t(t0, &fx_result->t0);
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_T2R9Ast__id_tLN14K_form__kexp_t(struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* dst)
{
   _fx_free_LN14K_form__kexp_t(&dst->t1);
}

static void _fx_copy_T2R9Ast__id_tLN14K_form__kexp_t(
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* src,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* dst)
{
   dst->t0 = src->t0;
   FX_COPY_PTR(src->t1, &dst->t1);
}

static void _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* t0,
   struct _fx_LN14K_form__kexp_t_data_t* t1,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result)
{
   fx_result->t0 = *t0;
   FX_COPY_PTR(t1, &fx_result->t1);
}

static void _fx_free_Ta2S(struct _fx_Ta2S* dst)
{
   fx_free_str(&dst->t0);
   fx_free_str(&dst->t1);
}

static void _fx_copy_Ta2S(struct _fx_Ta2S* src, struct _fx_Ta2S* dst)
{
   fx_copy_str(&src->t0, &dst->t0);
   fx_copy_str(&src->t1, &dst->t1);
}

static void _fx_make_Ta2S(fx_str_t* t0, fx_str_t* t1, struct _fx_Ta2S* fx_result)
{
   fx_copy_str(t0, &fx_result->t0);
   fx_copy_str(t1, &fx_result->t1);
}

_fx_Nt6option1rR23K_form__kdefinterface_t _fx_g12K_form__None = { 1 };
_fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t _fx_g14K_form__None1_ = 0;
_fx_Nt6option1N14K_form__atom_t _fx_g14K_form__None2_ = { 1 };
static _fx_N14K_form__ktyp_t_data_t KTypInt_data_0 = { 1, 1 };
_fx_N14K_form__ktyp_t _fx_g15K_form__KTypInt = &KTypInt_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypVoid_data_0 = { 1, 7 };
_fx_N14K_form__ktyp_t _fx_g16K_form__KTypVoid = &KTypVoid_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypBool_data_0 = { 1, 8 };
_fx_N14K_form__ktyp_t _fx_g16K_form__KTypBool = &KTypBool_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypChar_data_0 = { 1, 9 };
_fx_N14K_form__ktyp_t _fx_g16K_form__KTypChar = &KTypChar_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypString_data_0 = { 1, 10 };
_fx_N14K_form__ktyp_t _fx_g18K_form__KTypString = &KTypString_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypExn_data_0 = { 1, 21 };
_fx_N14K_form__ktyp_t _fx_g15K_form__KTypExn = &KTypExn_data_0;
static _fx_N14K_form__ktyp_t_data_t KTypErr_data_0 = { 1, 22 };
_fx_N14K_form__ktyp_t _fx_g15K_form__KTypErr = &KTypErr_data_0;
_fx_N15K_form__kinfo_t _fx_g13K_form__KNone = { 1 };
_fx_N14K_form__klit_t _fx_g17K_form___KLitVoid = {0};
_fx_N14K_form__atom_t _fx_g17K_form___ALitVoid = {0};
fx_arr_t _fx_g16K_form__all_idks = {0};
_fx_R9Ast__id_t _fx_g32K_form__builtin_exn_NoMatchError;
_fx_R9Ast__id_t _fx_g35K_form__builtin_exn_OutOfRangeError;
bool _fx_g19K_form__freeze_idks = false;
FX_EXTERN_C int _fx_F9make_FailE1S(fx_str_t* arg0, fx_exn_t* fx_result);

FX_EXTERN_C int _fx_M7HashsetFM9makeindexA1i1i(int_ size_0, fx_arr_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F6assertv1B(bool f_0, void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R9Ast__id_t _fx_g9Ast__noid)
FX_EXTERN_C_VAL(fx_arr_t _fx_g16Ast__all_modules)
FX_EXTERN_C int _fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(
   struct _fx_R9Ast__id_t* id_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_Ta2i* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM13get_id_prefixi1S(fx_str_t* s_0, int_* fx_result, void* fx_fv);

FX_EXTERN_C_VAL(struct _fx_R10Ast__loc_t _fx_g10Ast__noloc)
FX_EXTERN_C_VAL(bool _fx_g15Ast__freeze_ids)
FX_EXTERN_C int _fx_M3AstFM11get_end_locRM5loc_t1RM5loc_t(
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C void _fx_M3AstFM7ScBlockN12Ast__scope_t1i(int_ arg0, struct _fx_N12Ast__scope_t* fx_result);

FX_EXTERN_C int _fx_M3AstFM11compile_errE2RM5loc_tS(
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* msg_0,
   fx_exn_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6stringS1RM4id_t(struct _fx_R9Ast__id_t* i_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM18get_qualified_nameS2SLN12Ast__scope_t(
   fx_str_t* name_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   fx_str_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(
   struct _fx_LR10Ast__loc_t_data_t* llist_0,
   struct _fx_R10Ast__loc_t* default_loc_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* kt_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9walk_kexpN14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__atom_t* fx_result,
   void* fx_fv);

static int _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg0_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* fx_result,
   void* fx_fv);

static int _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_LN14K_form__atom_t_data_t* al_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LN14K_form__atom_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM13process_elistLN14K_form__kexp_t3LN14K_form__kexp_tLN14K_form__kexp_tRM9k_callb_t(
   struct _fx_LN14K_form__kexp_t_data_t* elist_0,
   struct _fx_LN14K_form__kexp_t_data_t* result_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

static int _fx_M6K_formFM9walk_dom_N13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N13K_form__dom_t* fx_result,
   void* fx_fv);

static int _fx_M6K_formFM14walk_idomlist_LT2R9Ast__id_tN13K_form__dom_t3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* idoml_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(
   struct _fx_LR9Ast__id_t_data_t* nl_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool update_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LR9Ast__id_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv);

static int _fx_M6K_formFM12update_kval_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM6__eq__B2RM4id_tRM4id_t(
   struct _fx_R9Ast__id_t* a_0,
   struct _fx_R9Ast__id_t* b_0,
   bool* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   struct _fx_R10Ast__loc_t* loc_0,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv1N14K_form__kexp_t1RM14k_fold_callb_t(
   struct _fx_R22K_form__k_fold_callb_t* arg0,
   struct _fx_FPv1N14K_form__kexp_t* fx_result);

static int _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_LN14K_form__atom_t_data_t* al_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM9fold_dom_v3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM11fold_idoml_v3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* idoml_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(
   struct _fx_LR9Ast__id_t_data_t* nl_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool kvals_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM10fold_kval_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t* e_0, void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* fx_result);

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* fx_result);

static int _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

static int _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM9make_fp1_FPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* fx_result);

static int _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_val_flagsRM11val_flags_t0(struct _fx_R16Ast__val_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM11curr_modulei1LN12Ast__scope_t(
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   int_* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1i(int_ a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(struct _fx_R16Ast__fun_flags_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_M6K_formFM7ktl2strS1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* tl_0,
   fx_str_t* fx_result,
   void* fx_fv);

FX_EXTERN_C int _fx_F7__mul__S2Ci(char_ c, int_ n, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1l(int64_t a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1q(uint64_t a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F6stringS1d(double a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C bool _fx_M4CharFM7isdigitB1C(char_ c, void* fx_fv);

FX_EXTERN_C int_ _fx_M6StringFM4findi3SSi(fx_str_t* s, fx_str_t* part, int_ from_pos, void* fx_fv);

FX_EXTERN_C int _fx_M6StringFM7escapedS2SB(fx_str_t* s_0, bool quotes_0, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F4reprS1C(char_ a, fx_str_t* fx_result, void* fx_fv);

FX_EXTERN_C int _fx_F12join_embraceS4SSSA1S(
   fx_str_t* begin,
   fx_str_t* end,
   fx_str_t* sep,
   fx_arr_t* strs,
   fx_str_t* fx_result,
   void* fx_fv);

typedef struct {
   int_ rc;
   fx_free_t free_f;
   struct _fx_R22K_form__k_fold_callb_t t0;
} _fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t_cldata_t;

FX_EXTERN_C void _fx_free_M6K_formFM10fold_kexp_v1N14K_form__kexp_t(_fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t_cldata_t* dst)
{
   _fx_free_R22K_form__k_fold_callb_t(&dst->t0);
   fx_free(dst);
}

typedef struct {
   int_ rc;
   fx_free_t free_f;
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* t0;
} _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t_cldata_t;

FX_EXTERN_C void _fx_free_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t_cldata_t* dst)
{
   _fx_free_Nt10Hashset__t1R9Ast__id_t(&dst->t0);
   fx_free(dst);
}

typedef struct {
   int_ rc;
   fx_free_t free_f;
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* t0;
} _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t;

FX_EXTERN_C void _fx_free_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t* dst)
{
   _fx_free_Nt10Hashset__t1R9Ast__id_t(&dst->t0);
   fx_free(dst);
}

typedef struct {
   int_ rc;
   fx_free_t free_f;
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* t0;
} _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t;

FX_EXTERN_C void _fx_free_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t* dst)
{
   _fx_free_Nt10Hashset__t1R9Ast__id_t(&dst->t0);
   fx_free(dst);
}

FX_EXTERN_C void _fx_M6K_formFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_Nt6option1N14K_form__kexp_t* fx_result)
{
   fx_result->tag = 2;
   FX_COPY_PTR(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M6K_formFM4SomeNt6option1rRM15kdefinterface_t1rRM15kdefinterface_t(
   struct _fx_rR23K_form__kdefinterface_t_data_t* arg0,
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* fx_result)
{
   fx_result->tag = 2;
   FX_COPY_PTR(arg0, &fx_result->u.Some);
}

FX_EXTERN_C int
   _fx_M6K_formFM4SomeNt6option1FPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t1FPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* arg0,
   struct _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t);
   FX_COPY_FP(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM4SomeNt6option1FPv2N14K_form__kexp_tRM14k_fold_callb_t1FPv2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* arg0,
   struct _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t);
   FX_COPY_FP(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM4SomeNt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t* arg0,
   struct _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t);
   FX_COPY_FP(arg0, &v->u.Some);
   return 0;
}

FX_EXTERN_C void _fx_M6K_formFM4SomeNt6option1N14K_form__atom_t1N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_Nt6option1N14K_form__atom_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_N14K_form__atom_t(arg0, &fx_result->u.Some);
}

FX_EXTERN_C void _fx_M6K_formFM5link2LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* l1,
   struct _fx_LN14K_form__kexp_t_data_t* l2,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   
fx_link_lists(l1, l2, fx_result);

}

FX_EXTERN_C int _fx_M6K_formFM3revLT2BN14K_form__atom_t1LT2BN14K_form__atom_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* l_0,
   struct _fx_LT2BN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LT2BN14K_form__atom_t __fold_result___0 = 0;
   int fx_status = 0;
   _fx_LT2BN14K_form__atom_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_LT2BN14K_form__atom_t r_0 = 0;
      _fx_T2BN14K_form__atom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(__fold_result___0, &r_0);
      FX_CALL(_fx_cons_LT2BN14K_form__atom_t(a_0, r_0, false, &r_0), _fx_catch_0);
      _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
      FX_COPY_PTR(r_0, &__fold_result___0);

   _fx_catch_0: ;
      if (r_0) {
         _fx_free_LT2BN14K_form__atom_t(&r_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(__fold_result___0, fx_result);

_fx_cleanup: ;
   if (__fold_result___0) {
      _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM3appv2LN14K_form__kexp_tFPv1N14K_form__kexp_t(
   struct _fx_LN14K_form__kexp_t_data_t* l_0,
   struct _fx_FPv1N14K_form__kexp_t* f_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LN14K_form__kexp_t lst_0 = l_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N14K_form__kexp_t x_0 = lst_0->hd;
      FX_CALL(f_0->fp(x_0, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6K_formFM1tNt10Hashset__t1R9Ast__id_t6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
   struct _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* arg0,
   int_ arg1,
   int_ arg2,
   int_ arg3,
   fx_arr_t* arg4,
   fx_arr_t* arg5,
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt10Hashset__t1R9Ast__id_t);
   v->u.t.t0 = *arg0;
   v->u.t.t1 = arg1;
   v->u.t.t2 = arg2;
   v->u.t.t3 = arg3;
   fx_copy_arr(arg4, &v->u.t.t4);
   fx_copy_arr(arg5, &v->u.t.t5);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM9add_fast_i4iA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_tRt24Hashset__hashset_entry_t1R9Ast__id_t(
   int_ tabsz_0,
   fx_arr_t* ht_index_0,
   fx_arr_t* ht_table_0,
   struct _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* entry_0,
   int_* fx_result,
   void* fx_fv)
{
   fx_exn_t v_0 = {0};
   int fx_status = 0;
   int_ idxsz_0 = FX_ARR_SIZE(*ht_index_0, 0);
   uint64_t hv_0 = entry_0->hv;
   uint64_t perturb_0 = hv_0;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   bool found_free_slot_0 = false;
   int_ v_1 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_1; i_0++) {
      FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, *ht_index_0, j_0);
      if (tidx_0 == 0) {
         FX_CHKIDX(FX_CHKIDX1(*ht_index_0, 0, j_0), _fx_catch_0);
         *FX_PTR_1D(int_, *ht_index_0, j_0) = tabsz_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(*ht_table_0, 0, tabsz_0), _fx_catch_0);
         *FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, *ht_table_0, tabsz_0) = *entry_0;
         found_free_slot_0 = true;
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (!found_free_slot_0) {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_0), _fx_cleanup);
      FX_THROW(&v_0, true, _fx_cleanup);
   }
   *fx_result = tabsz_0 + 1;

_fx_cleanup: ;
   fx_free_exn(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM4growv2Nt10Hashset__t1R9Ast__id_ti(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   int_ new_size_0,
   void* fx_fv)
{
   fx_arr_t ht_table_0 = {0};
   fx_arr_t new_ht_table_0 = {0};
   fx_arr_t new_ht_index_0 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t5, &ht_table_0);
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t v_0 = self_0->u.t.t0;
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* dstptr_0 = 0;
   {
      const int_ shape_0[] = { new_size_0 };
      FX_CALL(fx_make_arr(1, shape_0, sizeof(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t), 0, 0, 0, &new_ht_table_0),
         _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t*)new_ht_table_0.data;
   for (int_ i_0 = 0; i_0 < new_size_0; i_0++, dstptr_0++) {
      *dstptr_0 = v_0;
   }
   FX_CALL(_fx_M7HashsetFM9makeindexA1i1i(new_size_0 * 2, &new_ht_index_0, 0), _fx_cleanup);
   int_ tabsz_0 = 0;
   int_ v_1 = self_0->u.t.t2;
   for (int_ j_0 = 0; j_0 < v_1; j_0++) {
      FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
      if (FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, ht_table_0, j_0)->hv < 9223372036854775808ULL) {
         FX_CHKIDX(FX_CHKIDX1(ht_table_0, 0, j_0), _fx_catch_0);
         _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t v_2 =
            *FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, ht_table_0, j_0);
         int_ v_3;
         FX_CALL(
            _fx_M6K_formFM9add_fast_i4iA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_tRt24Hashset__hashset_entry_t1R9Ast__id_t(
               tabsz_0, &new_ht_index_0, &new_ht_table_0, &v_2, &v_3, 0), _fx_catch_0);
         tabsz_0 = v_3;
      }

   _fx_catch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   fx_arr_t* v_4 = &self_0->u.t.t4;
   FX_FREE_ARR(v_4);
   fx_copy_arr(&new_ht_index_0, v_4);
   fx_arr_t* v_5 = &self_0->u.t.t5;
   FX_FREE_ARR(v_5);
   fx_copy_arr(&new_ht_table_0, v_5);
   self_0->u.t.t2 = tabsz_0;
   self_0->u.t.t3 = 0;

_fx_cleanup: ;
   FX_FREE_ARR(&ht_table_0);
   FX_FREE_ARR(&new_ht_table_0);
   FX_FREE_ARR(&new_ht_index_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9find_idx_Ta2i3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   struct _fx_R9Ast__id_t* k_0,
   uint64_t hv_0,
   struct _fx_Ta2i* fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_1 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_1; i_0++) {
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_2 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_2), _fx_catch_0);
         _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t entry_0 =
            *FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, self_0->u.t.t5, v_2);
         bool t_0;
         if (entry_0.hv == hv_0) {
            _fx_R9Ast__id_t v_3 = entry_0.key;
            bool __fold_result___0 = true;
            bool t_1;
            if (v_3.m == k_0->m) {
               t_1 = __fold_result___0;
            }
            else {
               t_1 = false;
            }
            __fold_result___0 = t_1;
            bool t_2;
            if (v_3.i == k_0->i) {
               t_2 = __fold_result___0;
            }
            else {
               t_2 = false;
            }
            __fold_result___0 = t_2;
            bool t_3;
            if (v_3.j == k_0->j) {
               t_3 = __fold_result___0;
            }
            else {
               t_3 = false;
            }
            __fold_result___0 = t_3;
            t_0 = __fold_result___0;
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         FX_BREAK(_fx_catch_0);
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_Ta2i tup_0 = { j_0, found_0 };
   *fx_result = tup_0;

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM3memB2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   struct _fx_R9Ast__id_t* k_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   uint64_t __fold_result___0 = 14695981039346656037ULL;
   uint64_t h_0 = __fold_result___0 ^ ((uint64_t)k_0->m ^ 14695981039346656037ULL);
   __fold_result___0 = h_0 * 1099511628211ULL;
   uint64_t h_1 = __fold_result___0 ^ ((uint64_t)k_0->i ^ 14695981039346656037ULL);
   __fold_result___0 = h_1 * 1099511628211ULL;
   uint64_t h_2 = __fold_result___0 ^ ((uint64_t)k_0->j ^ 14695981039346656037ULL);
   __fold_result___0 = h_2 * 1099511628211ULL;
   _fx_Ta2i v_0;
   FX_CALL(
      _fx_M6K_formFM9find_idx_Ta2i3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(self_0, k_0,
         __fold_result___0 & 9223372036854775807ULL, &v_0, 0), _fx_cleanup);
   *fx_result = v_0.t1 >= 0;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   struct _fx_R9Ast__id_t* k_0,
   uint64_t hv_0,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   fx_exn_t v_2 = {0};
   int fx_status = 0;
   fx_copy_arr(&self_0->u.t.t4, &v_0);
   int_ idxsz_0 = FX_ARR_SIZE(v_0, 0);
   if (self_0->u.t.t1 + 1 > idxsz_0 >> 1) {
      while (idxsz_0 < (self_0->u.t.t1 + 1) * 2) {
         idxsz_0 = idxsz_0 * 2;
      }
      FX_CALL(_fx_M6K_formFM4growv2Nt10Hashset__t1R9Ast__id_ti(self_0, fx_maxi(idxsz_0 / 2, self_0->u.t.t1 + 1), 0),
         _fx_cleanup);
   }
   uint64_t perturb_0 = hv_0;
   int_ found_0 = -1;
   int_ insert_idx_0 = -1;
   int_ j_0 = (int_)hv_0 & (idxsz_0 - 1);
   int_ v_3 = idxsz_0 + 14;
   for (int_ i_0 = 0; i_0 < v_3; i_0++) {
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_catch_0);
      int_ tidx_0 = *FX_PTR_1D(int_, self_0->u.t.t4, j_0);
      if (tidx_0 >= 2) {
         int_ v_4 = tidx_0 - 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, v_4), _fx_catch_0);
         _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t entry_0 =
            *FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, self_0->u.t.t5, v_4);
         bool t_0;
         if (entry_0.hv == hv_0) {
            _fx_R9Ast__id_t v_5 = entry_0.key;
            bool __fold_result___0 = true;
            bool t_1;
            if (v_5.m == k_0->m) {
               t_1 = __fold_result___0;
            }
            else {
               t_1 = false;
            }
            __fold_result___0 = t_1;
            bool t_2;
            if (v_5.i == k_0->i) {
               t_2 = __fold_result___0;
            }
            else {
               t_2 = false;
            }
            __fold_result___0 = t_2;
            bool t_3;
            if (v_5.j == k_0->j) {
               t_3 = __fold_result___0;
            }
            else {
               t_3 = false;
            }
            __fold_result___0 = t_3;
            t_0 = __fold_result___0;
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            found_0 = tidx_0 - 2; FX_BREAK(_fx_catch_0);
         }
      }
      else if (tidx_0 == 0) {
         if (insert_idx_0 < 0) {
            insert_idx_0 = j_0;
         }
         FX_BREAK(_fx_catch_0);
      }
      else {
         bool t_4;
         if (tidx_0 == 1) {
            t_4 = insert_idx_0 < 0;
         }
         else {
            t_4 = false;
         }
         if (t_4) {
            insert_idx_0 = j_0;
         }
      }
      perturb_0 = perturb_0 >> 5;
      j_0 = (int_)((uint64_t)(j_0 * 5 + 1) + perturb_0) & (idxsz_0 - 1);

   _fx_catch_0: ;
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (found_0 >= 0) {
      bool t_5;
      if (insert_idx_0 >= 0) {
         t_5 = insert_idx_0 != j_0;
      }
      else {
         t_5 = false;
      }
      if (t_5) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_cleanup);
         *FX_PTR_1D(int_, self_0->u.t.t4, j_0) = 1;
      }
   }
   else if (insert_idx_0 >= 0) {
      found_0 = self_0->u.t.t3 - 1;
      if (found_0 >= 0) {
         FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
         self_0->u.t.t3 =
            (int_)
               (FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, self_0->u.t.t5, found_0)->hv & 9223372036854775807ULL);
      }
      else {
         found_0 = self_0->u.t.t2;
         self_0->u.t.t2 = self_0->u.t.t2 + 1;
         fx_copy_arr(&self_0->u.t.t5, &v_1);
         FX_CALL(_fx_F6assertv1B(found_0 < FX_ARR_SIZE(v_1, 0), 0), _fx_cleanup);
      }
      _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t v_6 = { hv_0, *k_0 };
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, found_0), _fx_cleanup);
      *FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, self_0->u.t.t5, found_0) = v_6;
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, insert_idx_0), _fx_cleanup);
      *FX_PTR_1D(int_, self_0->u.t.t4, insert_idx_0) = found_0 + 2;
      self_0->u.t.t1 = self_0->u.t.t1 + 1;
   }
   else {
      fx_str_t slit_0 = FX_MAKE_STR("cannot insert element (full Hashtable?!)");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_2), _fx_cleanup);
      FX_THROW(&v_2, true, _fx_cleanup);
   }

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   fx_free_exn(&v_2);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   struct _fx_R9Ast__id_t* k_0,
   void* fx_fv)
{
   int fx_status = 0;
   uint64_t __fold_result___0 = 14695981039346656037ULL;
   uint64_t h_0 = __fold_result___0 ^ ((uint64_t)k_0->m ^ 14695981039346656037ULL);
   __fold_result___0 = h_0 * 1099511628211ULL;
   uint64_t h_1 = __fold_result___0 ^ ((uint64_t)k_0->i ^ 14695981039346656037ULL);
   __fold_result___0 = h_1 * 1099511628211ULL;
   uint64_t h_2 = __fold_result___0 ^ ((uint64_t)k_0->j ^ 14695981039346656037ULL);
   __fold_result___0 = h_2 * 1099511628211ULL;
   FX_CALL(
      _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(self_0, k_0, __fold_result___0 & 9223372036854775807ULL, 0),
      _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM6removev2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* self_0,
   struct _fx_R9Ast__id_t* k_0,
   void* fx_fv)
{
   int fx_status = 0;
   uint64_t __fold_result___0 = 14695981039346656037ULL;
   uint64_t h_0 = __fold_result___0 ^ ((uint64_t)k_0->m ^ 14695981039346656037ULL);
   __fold_result___0 = h_0 * 1099511628211ULL;
   uint64_t h_1 = __fold_result___0 ^ ((uint64_t)k_0->i ^ 14695981039346656037ULL);
   __fold_result___0 = h_1 * 1099511628211ULL;
   uint64_t h_2 = __fold_result___0 ^ ((uint64_t)k_0->j ^ 14695981039346656037ULL);
   __fold_result___0 = h_2 * 1099511628211ULL;
   _fx_Ta2i v_0;
   FX_CALL(
      _fx_M6K_formFM9find_idx_Ta2i3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(self_0, k_0,
         __fold_result___0 & 9223372036854775807ULL, &v_0, 0), _fx_cleanup);
   int_ j_0 = v_0.t0;
   int_ tidx_0 = v_0.t1;
   if (tidx_0 >= 0) {
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t4, 0, j_0), _fx_cleanup);
      *FX_PTR_1D(int_, self_0->u.t.t4, j_0) = 1;
      FX_CHKIDX(FX_CHKIDX1(self_0->u.t.t5, 0, tidx_0), _fx_cleanup);
      FX_PTR_1D(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t, self_0->u.t.t5, tidx_0)->hv =
         (uint64_t)self_0->u.t.t3 | 9223372036854775808ULL;
      self_0->u.t.t3 = tidx_0 + 1;
      self_0->u.t.t1 = self_0->u.t.t1 - 1;
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM1tNt9Dynvec__t1N15K_form__kinfo_t3iA1N15K_form__kinfo_tN15K_form__kinfo_t(
   int_ arg0,
   fx_arr_t* arg1,
   struct _fx_N15K_form__kinfo_t* arg2,
   struct _fx_Nt9Dynvec__t1N15K_form__kinfo_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_Nt9Dynvec__t1N15K_form__kinfo_t);
   v->u.t.t0 = arg0;
   fx_copy_arr(arg1, &v->u.t.t1);
   _fx_copy_N15K_form__kinfo_t(arg2, &v->u.t.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KTypSIntN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 3;
   v->u.KTypSInt = arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KTypUIntN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 4;
   v->u.KTypUInt = arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KTypFloatN14K_form__ktyp_t1i(int_ arg0, struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 5;
   v->u.KTypFloat = arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM14KTypRawPointerN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 12;
   FX_COPY_PTR(arg0, &v->u.KTypRawPointer);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KTypFunN14K_form__ktyp_t2LN14K_form__ktyp_tN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 13;
   FX_COPY_PTR(arg0, &v->u.KTypFun.t0);
   FX_COPY_PTR(arg1, &v->u.KTypFun.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 14;
   FX_COPY_PTR(arg0, &v->u.KTypTuple);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_LT2R9Ast__id_tN14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 15;
   v->u.KTypRecord.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.KTypRecord.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 16;
   v->u.KTypName = *arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KTypArrayN14K_form__ktyp_t2iN14K_form__ktyp_t(
   int_ arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 17;
   v->u.KTypArray.t0 = arg0;
   FX_COPY_PTR(arg1, &v->u.KTypArray.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10KTypVectorN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 18;
   FX_COPY_PTR(arg0, &v->u.KTypVector);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KTypListN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 19;
   FX_COPY_PTR(arg0, &v->u.KTypList);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KTypRefN14K_form__ktyp_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__ktyp_t);
   v->tag = 20;
   FX_COPY_PTR(arg0, &v->u.KTypRef);
   return 0;
}

FX_EXTERN_C void _fx_M6K_formFM7KLitIntN14K_form__klit_t1l(int64_t arg0, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 1;
   fx_result->u.KLitInt = arg0;
}

FX_EXTERN_C void _fx_M6K_formFM8KLitSIntN14K_form__klit_t2il(int_ arg0, int64_t arg1, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 2;
   fx_result->u.KLitSInt.t0 = arg0;
   fx_result->u.KLitSInt.t1 = arg1;
}

FX_EXTERN_C void _fx_M6K_formFM8KLitUIntN14K_form__klit_t2iq(int_ arg0, uint64_t arg1, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 3;
   fx_result->u.KLitUInt.t0 = arg0;
   fx_result->u.KLitUInt.t1 = arg1;
}

FX_EXTERN_C void _fx_M6K_formFM9KLitFloatN14K_form__klit_t2id(int_ arg0, double arg1, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 4;
   fx_result->u.KLitFloat.t0 = arg0;
   fx_result->u.KLitFloat.t1 = arg1;
}

FX_EXTERN_C void _fx_M6K_formFM10KLitStringN14K_form__klit_t1S(fx_str_t* arg0, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 5;
   fx_copy_str(arg0, &fx_result->u.KLitString);
}

FX_EXTERN_C void _fx_M6K_formFM8KLitCharN14K_form__klit_t1C(char_ arg0, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 6;
   fx_result->u.KLitChar = arg0;
}

FX_EXTERN_C void _fx_M6K_formFM8KLitBoolN14K_form__klit_t1B(bool arg0, struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 7;
   fx_result->u.KLitBool = arg0;
}

FX_EXTERN_C void _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* arg0,
   struct _fx_N14K_form__klit_t* fx_result)
{
   fx_result->tag = 8;
   FX_COPY_PTR(arg0, &fx_result->u.KLitNil);
}

FX_EXTERN_C void _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__atom_t* fx_result)
{
   fx_result->tag = 1;
   fx_result->u.AtomId = *arg0;
}

FX_EXTERN_C void _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(
   struct _fx_N14K_form__klit_t* arg0,
   struct _fx_N14K_form__atom_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_N14K_form__klit_t(arg0, &fx_result->u.AtomLit);
}

FX_EXTERN_C void _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N13K_form__dom_t* fx_result)
{
   fx_result->tag = 1;
   _fx_copy_N14K_form__atom_t(arg0, &fx_result->u.DomainElem);
}

FX_EXTERN_C void _fx_M6K_formFM10DomainFastN13K_form__dom_t1N14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N13K_form__dom_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_N14K_form__atom_t(arg0, &fx_result->u.DomainFast);
}

FX_EXTERN_C void _fx_M6K_formFM11DomainRangeN13K_form__dom_t3N14K_form__atom_tN14K_form__atom_tN14K_form__atom_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_N14K_form__atom_t* arg2,
   struct _fx_N13K_form__dom_t* fx_result)
{
   fx_result->tag = 3;
   _fx_copy_N14K_form__atom_t(arg0, &fx_result->u.DomainRange.t0);
   _fx_copy_N14K_form__atom_t(arg1, &fx_result->u.DomainRange.t1);
   _fx_copy_N14K_form__atom_t(arg2, &fx_result->u.DomainRange.t2);
}

FX_EXTERN_C int _fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 1;
   v->u.KExpNop = *arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpBreakN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 2;
   v->u.KExpBreak = *arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM12KExpContinueN14K_form__kexp_t1R10Ast__loc_t(
   struct _fx_R10Ast__loc_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 3;
   v->u.KExpContinue = *arg0;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10KExpReturnN14K_form__kexp_t2Nt6option1N14K_form__atom_tR10Ast__loc_t(
   struct _fx_Nt6option1N14K_form__atom_t* arg0,
   struct _fx_R10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 4;
   _fx_copy_Nt6option1N14K_form__atom_t(arg0, &v->u.KExpReturn.t0);
   v->u.KExpReturn.t1 = *arg1;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 5;
   _fx_copy_N14K_form__atom_t(arg0, &v->u.KExpAtom.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpAtom.t1);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__binary_t_data_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_N14K_form__atom_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 6;
   FX_COPY_PTR(arg0, &v->u.KExpBinary.t0);
   _fx_copy_N14K_form__atom_t(arg1, &v->u.KExpBinary.t1);
   _fx_copy_N14K_form__atom_t(arg2, &v->u.KExpBinary.t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg3, &v->u.KExpBinary.t3);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N12Ast__unary_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 7;
   v->u.KExpUnary.t0 = *arg0;
   _fx_copy_N14K_form__atom_t(arg1, &v->u.KExpUnary.t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpUnary.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N13Ast__intrin_t* arg0,
   struct _fx_LN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 8;
   v->u.KExpIntrin.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.KExpIntrin.t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpIntrin.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KExpSyncN14K_form__kexp_t2R9Ast__id_tN14K_form__kexp_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 9;
   v->u.KExpSync.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.KExpSync.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KExpSeqN14K_form__kexp_t2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 10;
   FX_COPY_PTR(arg0, &v->u.KExpSeq.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpSeq.t1);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 11;
   FX_COPY_PTR(arg0, &v->u.KExpIf.t0);
   FX_COPY_PTR(arg1, &v->u.KExpIf.t1);
   FX_COPY_PTR(arg2, &v->u.KExpIf.t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg3, &v->u.KExpIf.t3);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_LN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 12;
   v->u.KExpCall.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.KExpCall.t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpCall.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpICallN14K_form__kexp_t4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   int_ arg1,
   struct _fx_LN14K_form__atom_t_data_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 13;
   v->u.KExpICall.t0 = *arg0;
   v->u.KExpICall.t1 = arg1;
   FX_COPY_PTR(arg2, &v->u.KExpICall.t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg3, &v->u.KExpICall.t3);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 14;
   FX_COPY_PTR(arg0, &v->u.KExpMkTuple.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpMkTuple.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM12KExpMkRecordN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 15;
   FX_COPY_PTR(arg0, &v->u.KExpMkRecord.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpMkRecord.t1);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM13KExpMkClosureN14K_form__kexp_t4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_R9Ast__id_t* arg1,
   struct _fx_LN14K_form__atom_t_data_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 16;
   v->u.KExpMkClosure.t0 = *arg0;
   v->u.KExpMkClosure.t1 = *arg1;
   FX_COPY_PTR(arg2, &v->u.KExpMkClosure.t2);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg3, &v->u.KExpMkClosure.t3);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   bool arg0,
   struct _fx_LLT2BN14K_form__atom_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 17;
   v->u.KExpMkArray.t0 = arg0;
   FX_COPY_PTR(arg1, &v->u.KExpMkArray.t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpMkArray.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM12KExpMkVectorN14K_form__kexp_t2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2BN14K_form__atom_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 18;
   FX_COPY_PTR(arg0, &v->u.KExpMkVector.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpMkVector.t1);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM6KExpAtN14K_form__kexp_t5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N13Ast__border_t* arg1,
   struct _fx_N18Ast__interpolate_t* arg2,
   struct _fx_LN13K_form__dom_t_data_t* arg3,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg4,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 19;
   _fx_copy_N14K_form__atom_t(arg0, &v->u.KExpAt.t0);
   v->u.KExpAt.t1 = *arg1;
   v->u.KExpAt.t2 = *arg2;
   FX_COPY_PTR(arg3, &v->u.KExpAt.t3);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg4, &v->u.KExpAt.t4);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   int_ arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 20;
   v->u.KExpMem.t0 = *arg0;
   v->u.KExpMem.t1 = arg1;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpMem.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10KExpAssignN14K_form__kexp_t3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__atom_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 21;
   v->u.KExpAssign.t0 = *arg0;
   _fx_copy_N14K_form__atom_t(arg1, &v->u.KExpAssign.t1);
   v->u.KExpAssign.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t_data_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 22;
   FX_COPY_PTR(arg0, &v->u.KExpMatch.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpMatch.t1);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM12KExpTryCatchN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 23;
   FX_COPY_PTR(arg0, &v->u.KExpTryCatch.t0);
   FX_COPY_PTR(arg1, &v->u.KExpTryCatch.t1);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg2, &v->u.KExpTryCatch.t2);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   bool arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 24;
   v->u.KExpThrow.t0 = *arg0;
   v->u.KExpThrow.t1 = arg1;
   v->u.KExpThrow.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* arg0,
   struct _fx_N14K_form__ktyp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 25;
   _fx_copy_N14K_form__atom_t(arg0, &v->u.KExpCast.t0);
   FX_COPY_PTR(arg1, &v->u.KExpCast.t1);
   v->u.KExpCast.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM7KExpMapN14K_form__kexp_t4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R16Ast__for_flags_t* arg2,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg3,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 26;
   FX_COPY_PTR(arg0, &v->u.KExpMap.t0);
   FX_COPY_PTR(arg1, &v->u.KExpMap.t1);
   v->u.KExpMap.t2 = *arg2;
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg3, &v->u.KExpMap.t3);
   return 0;
}

FX_EXTERN_C int
   _fx_M6K_formFM7KExpForN14K_form__kexp_t5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* arg0,
   struct _fx_LR9Ast__id_t_data_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t* arg2,
   struct _fx_R16Ast__for_flags_t* arg3,
   struct _fx_R10Ast__loc_t* arg4,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 27;
   FX_COPY_PTR(arg0, &v->u.KExpFor.t0);
   FX_COPY_PTR(arg1, &v->u.KExpFor.t1);
   FX_COPY_PTR(arg2, &v->u.KExpFor.t2);
   v->u.KExpFor.t3 = *arg3;
   v->u.KExpFor.t4 = *arg4;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 28;
   FX_COPY_PTR(arg0, &v->u.KExpWhile.t0);
   FX_COPY_PTR(arg1, &v->u.KExpWhile.t1);
   v->u.KExpWhile.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM11KExpDoWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_N14K_form__kexp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 29;
   FX_COPY_PTR(arg0, &v->u.KExpDoWhile.t0);
   FX_COPY_PTR(arg1, &v->u.KExpDoWhile.t1);
   v->u.KExpDoWhile.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM9KExpCCodeN14K_form__kexp_t2ST2N14K_form__ktyp_tR10Ast__loc_t(
   fx_str_t* arg0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg1,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 30;
   fx_copy_str(arg0, &v->u.KExpCCode.t0);
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(arg1, &v->u.KExpCCode.t1);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KDefValN14K_form__kexp_t3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t* arg1,
   struct _fx_R10Ast__loc_t* arg2,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 31;
   v->u.KDefVal.t0 = *arg0;
   FX_COPY_PTR(arg1, &v->u.KDefVal.t1);
   v->u.KDefVal.t2 = *arg2;
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KDefFunN14K_form__kexp_t1rRM9kdeffun_t(
   struct _fx_rR17K_form__kdeffun_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 32;
   FX_COPY_PTR(arg0, &v->u.KDefFun);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KDefExnN14K_form__kexp_t1rRM9kdefexn_t(
   struct _fx_rR17K_form__kdefexn_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 33;
   FX_COPY_PTR(arg0, &v->u.KDefExn);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM11KDefVariantN14K_form__kexp_t1rRM13kdefvariant_t(
   struct _fx_rR21K_form__kdefvariant_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 34;
   FX_COPY_PTR(arg0, &v->u.KDefVariant);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM13KDefInterfaceN14K_form__kexp_t1rRM15kdefinterface_t(
   struct _fx_rR23K_form__kdefinterface_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 35;
   FX_COPY_PTR(arg0, &v->u.KDefInterface);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM7KDefTypN14K_form__kexp_t1rRM9kdeftyp_t(
   struct _fx_rR17K_form__kdeftyp_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 36;
   FX_COPY_PTR(arg0, &v->u.KDefTyp);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM15KDefClosureVarsN14K_form__kexp_t1rRM17kdefclosurevars_t(
   struct _fx_rR25K_form__kdefclosurevars_t_data_t* arg0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result)
{
   FX_MAKE_RECURSIVE_VARIANT_IMPL_START(_fx_N14K_form__kexp_t);
   v->tag = 37;
   FX_COPY_PTR(arg0, &v->u.KDefClosureVars);
   return 0;
}

FX_EXTERN_C void _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(
   struct _fx_R17K_form__kdefval_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 2;
   _fx_copy_R17K_form__kdefval_t(arg0, &fx_result->u.KVal);
}

FX_EXTERN_C void _fx_M6K_formFM4KFunN15K_form__kinfo_t1rRM9kdeffun_t(
   struct _fx_rR17K_form__kdeffun_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 3;
   FX_COPY_PTR(arg0, &fx_result->u.KFun);
}

FX_EXTERN_C void _fx_M6K_formFM4KExnN15K_form__kinfo_t1rRM9kdefexn_t(
   struct _fx_rR17K_form__kdefexn_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 4;
   FX_COPY_PTR(arg0, &fx_result->u.KExn);
}

FX_EXTERN_C void _fx_M6K_formFM8KVariantN15K_form__kinfo_t1rRM13kdefvariant_t(
   struct _fx_rR21K_form__kdefvariant_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 5;
   FX_COPY_PTR(arg0, &fx_result->u.KVariant);
}

FX_EXTERN_C void _fx_M6K_formFM12KClosureVarsN15K_form__kinfo_t1rRM17kdefclosurevars_t(
   struct _fx_rR25K_form__kdefclosurevars_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 6;
   FX_COPY_PTR(arg0, &fx_result->u.KClosureVars);
}

FX_EXTERN_C void _fx_M6K_formFM10KInterfaceN15K_form__kinfo_t1rRM15kdefinterface_t(
   struct _fx_rR23K_form__kdefinterface_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 7;
   FX_COPY_PTR(arg0, &fx_result->u.KInterface);
}

FX_EXTERN_C void _fx_M6K_formFM4KTypN15K_form__kinfo_t1rRM9kdeftyp_t(
   struct _fx_rR17K_form__kdeftyp_t_data_t* arg0,
   struct _fx_N15K_form__kinfo_t* fx_result)
{
   fx_result->tag = 8;
   FX_COPY_PTR(arg0, &fx_result->u.KTyp);
}

FX_EXTERN_C int _fx_M6K_formFM11new_idk_idxi1i(int_ m_idx_0, int_* fx_result, void* fx_fv)
{
   fx_exn_t v_0 = {0};
   _fx_Nt9Dynvec__t1N14Ast__id_info_t v_1 = 0;
   fx_arr_t v_2 = {0};
   fx_arr_t old_data_0 = {0};
   _fx_N14Ast__id_info_t val0_0 = {0};
   fx_arr_t new_data_0 = {0};
   _fx_Nt9Dynvec__t1N15K_form__kinfo_t v_3 = 0;
   fx_arr_t v_4 = {0};
   fx_arr_t old_data_1 = {0};
   _fx_N15K_form__kinfo_t val0_1 = {0};
   fx_arr_t new_data_1 = {0};
   fx_exn_t v_5 = {0};
   int fx_status = 0;
   if (_fx_g19K_form__freeze_idks) {
      fx_str_t slit_0 = FX_MAKE_STR("internal error: new idk is requested when they are frozen");
      FX_CALL(_fx_F9make_FailE1S(&slit_0, &v_0), _fx_cleanup);
      FX_THROW(&v_0, true, _fx_cleanup);
   }
   FX_CHKIDX(FX_CHKIDX1(_fx_g16Ast__all_modules, 0, m_idx_0), _fx_cleanup);
   FX_COPY_PTR((*FX_PTR_1D(_fx_N16Ast__defmodule_t, _fx_g16Ast__all_modules, m_idx_0))->u.defmodule_t.t9, &v_1);
   fx_copy_arr(&v_1->u.t.t1, &v_2);
   int_ sz_0 = FX_ARR_SIZE(v_2, 0);
   int_ n0_0 = v_1->u.t.t0;
   if (sz_0 <= n0_0) {
      int_ n1_0 = fx_maxi(n0_0, 128) * 2;
      fx_copy_arr(&v_1->u.t.t1, &old_data_0);
      _fx_copy_N14Ast__id_info_t(&v_1->u.t.t2, &val0_0);
      _fx_N14Ast__id_info_t* dstptr_0 = 0;
      {
         const int_ shape_0[] = { n1_0 };
         FX_CALL(
            fx_make_arr(1, shape_0, sizeof(_fx_N14Ast__id_info_t), (fx_free_t)_fx_free_N14Ast__id_info_t,
               (fx_copy_t)_fx_copy_N14Ast__id_info_t, 0, &new_data_0), _fx_cleanup);
      }
      dstptr_0 = (_fx_N14Ast__id_info_t*)new_data_0.data;
      for (int_ i_0 = 0; i_0 < n1_0; i_0++, dstptr_0++) {
         _fx_N14Ast__id_info_t t_0 = {0};
         if (i_0 < n0_0) {
            FX_CHKIDX(FX_CHKIDX1(old_data_0, 0, i_0), _fx_catch_0);
            _fx_copy_N14Ast__id_info_t(FX_PTR_1D(_fx_N14Ast__id_info_t, old_data_0, i_0), &t_0);
         }
         else {
            _fx_copy_N14Ast__id_info_t(&val0_0, &t_0);
         }
         _fx_copy_N14Ast__id_info_t(&t_0, dstptr_0);

      _fx_catch_0: ;
         _fx_free_N14Ast__id_info_t(&t_0);
         FX_CHECK_EXN(_fx_cleanup);
      }
      fx_arr_t* v_6 = &v_1->u.t.t1;
      FX_FREE_ARR(v_6);
      fx_copy_arr(&new_data_0, v_6);
   }
   v_1->u.t.t0 = n0_0 + 1;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_idx_0), _fx_cleanup);
   FX_COPY_PTR(*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_idx_0), &v_3);
   fx_copy_arr(&v_3->u.t.t1, &v_4);
   int_ sz_1 = FX_ARR_SIZE(v_4, 0);
   int_ n0_1 = v_3->u.t.t0;
   if (sz_1 <= n0_1) {
      int_ n1_1 = fx_maxi(n0_1, 128) * 2;
      fx_copy_arr(&v_3->u.t.t1, &old_data_1);
      _fx_copy_N15K_form__kinfo_t(&v_3->u.t.t2, &val0_1);
      _fx_N15K_form__kinfo_t* dstptr_1 = 0;
      {
         const int_ shape_1[] = { n1_1 };
         FX_CALL(
            fx_make_arr(1, shape_1, sizeof(_fx_N15K_form__kinfo_t), (fx_free_t)_fx_free_N15K_form__kinfo_t,
               (fx_copy_t)_fx_copy_N15K_form__kinfo_t, 0, &new_data_1), _fx_cleanup);
      }
      dstptr_1 = (_fx_N15K_form__kinfo_t*)new_data_1.data;
      for (int_ i_1 = 0; i_1 < n1_1; i_1++, dstptr_1++) {
         _fx_N15K_form__kinfo_t t_1 = {0};
         if (i_1 < n0_1) {
            FX_CHKIDX(FX_CHKIDX1(old_data_1, 0, i_1), _fx_catch_1);
            _fx_copy_N15K_form__kinfo_t(FX_PTR_1D(_fx_N15K_form__kinfo_t, old_data_1, i_1), &t_1);
         }
         else {
            _fx_copy_N15K_form__kinfo_t(&val0_1, &t_1);
         }
         _fx_copy_N15K_form__kinfo_t(&t_1, dstptr_1);

      _fx_catch_1: ;
         _fx_free_N15K_form__kinfo_t(&t_1);
         FX_CHECK_EXN(_fx_cleanup);
      }
      fx_arr_t* v_7 = &v_3->u.t.t1;
      FX_FREE_ARR(v_7);
      fx_copy_arr(&new_data_1, v_7);
   }
   v_3->u.t.t0 = n0_1 + 1;
   if (n0_0 != n0_1) {
      fx_str_t slit_1 = FX_MAKE_STR("internal error: unsynchronized outputs from new_id_idx() and new_idk_idx()");
      FX_CALL(_fx_F9make_FailE1S(&slit_1, &v_5), _fx_cleanup);
      FX_THROW(&v_5, true, _fx_cleanup);
   }
   *fx_result = n0_1;

_fx_cleanup: ;
   fx_free_exn(&v_0);
   if (v_1) {
      _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(&v_1);
   }
   FX_FREE_ARR(&v_2);
   FX_FREE_ARR(&old_data_0);
   _fx_free_N14Ast__id_info_t(&val0_0);
   FX_FREE_ARR(&new_data_0);
   if (v_3) {
      _fx_free_Nt9Dynvec__t1N15K_form__kinfo_t(&v_3);
   }
   FX_FREE_ARR(&v_4);
   FX_FREE_ARR(&old_data_1);
   _fx_free_N15K_form__kinfo_t(&val0_1);
   FX_FREE_ARR(&new_data_1);
   fx_free_exn(&v_5);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N15K_form__kinfo_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, fx_result);
   }
   else {
      _fx_Ta2i v_0;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      int_ m_0 = v_0.t0;
      int_ j_0 = v_0.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), fx_result);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7dup_idkR9Ast__id_t2iR9Ast__id_t(
   int_ m_idx_0,
   struct _fx_R9Ast__id_t* old_id_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int_ j_0;
   FX_CALL(_fx_M6K_formFM11new_idk_idxi1i(m_idx_0, &j_0, 0), _fx_cleanup);
   int_ t_0;
   if (old_id_0->i != 0) {
      t_0 = old_id_0->i;
   }
   else {
      t_0 = 1;
   }
   _fx_R9Ast__id_t rec_0 = { m_idx_0, t_0, j_0 };
   *fx_result = rec_0;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7gen_idkR9Ast__id_t2iS(
   int_ m_idx_0,
   fx_str_t* s_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int_ i_0;
   FX_CALL(_fx_M3AstFM13get_id_prefixi1S(s_0, &i_0, 0), _fx_cleanup);
   int_ j_0;
   FX_CALL(_fx_M6K_formFM11new_idk_idxi1i(m_idx_0, &j_0, 0), _fx_cleanup);
   _fx_R9Ast__id_t rec_0 = { m_idx_0, i_0, j_0 };
   *fx_result = rec_0;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_N15K_form__kinfo_t* info_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_Ta2i v_0;
   FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, &_fx_g10Ast__noloc, &v_0, 0), _fx_cleanup);
   int_ m_0 = v_0.t0;
   int_ j_0 = v_0.t1;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
   FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
      _fx_cleanup);
   _fx_N15K_form__kinfo_t* v_1 =
      FX_PTR_1D(_fx_N15K_form__kinfo_t, (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1,
         j_0);
   _fx_free_N15K_form__kinfo_t(v_1);
   _fx_copy_N15K_form__kinfo_t(info_0, v_1);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13init_all_idksv0(void* fx_fv)
{
   fx_arr_t v_0 = {0};
   int fx_status = 0;
   _fx_g15Ast__freeze_ids = true;
   _fx_g19K_form__freeze_idks = false;
   _fx_Nt9Dynvec__t1N15K_form__kinfo_t* dstptr_0 = 0;
   int_ ni_0 = FX_ARR_SIZE(_fx_g16Ast__all_modules, 0);
   _fx_N16Ast__defmodule_t* ptr_all_modules_0 = FX_PTR_1D(_fx_N16Ast__defmodule_t, _fx_g16Ast__all_modules, 0);
   {
      const int_ shape_0[] = { ni_0 };
      FX_CALL(
         fx_make_arr(1, shape_0, sizeof(_fx_Nt9Dynvec__t1N15K_form__kinfo_t),
            (fx_free_t)_fx_free_Nt9Dynvec__t1N15K_form__kinfo_t, (fx_copy_t)fx_copy_ptr, 0, &v_0), _fx_cleanup);
   }
   dstptr_0 = (_fx_Nt9Dynvec__t1N15K_form__kinfo_t*)v_0.data;
   for (int_ i_0 = 0; i_0 < ni_0; i_0++, dstptr_0++) {
      _fx_N16Ast__defmodule_t dm_0 = 0;
      _fx_Nt9Dynvec__t1N14Ast__id_info_t v_1 = 0;
      fx_arr_t v_2 = {0};
      _fx_Nt9Dynvec__t1N15K_form__kinfo_t res_0 = 0;
      FX_COPY_PTR(ptr_all_modules_0[i_0], &dm_0);
      FX_COPY_PTR(dm_0->u.defmodule_t.t9, &v_1);
      int_ sz_0 = v_1->u.t.t0;
      _fx_N15K_form__kinfo_t* dstptr_1 = 0;
      {
         const int_ shape_1[] = { sz_0 };
         FX_CALL(
            fx_make_arr(1, shape_1, sizeof(_fx_N15K_form__kinfo_t), (fx_free_t)_fx_free_N15K_form__kinfo_t,
               (fx_copy_t)_fx_copy_N15K_form__kinfo_t, 0, &v_2), _fx_catch_0);
      }
      dstptr_1 = (_fx_N15K_form__kinfo_t*)v_2.data;
      for (int_ i_1 = 0; i_1 < sz_0; i_1++, dstptr_1++) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, dstptr_1);
      }
      FX_CALL(
         _fx_M6K_formFM1tNt9Dynvec__t1N15K_form__kinfo_t3iA1N15K_form__kinfo_tN15K_form__kinfo_t(sz_0, &v_2,
            &_fx_g13K_form__KNone, &res_0), _fx_catch_0);
      FX_COPY_PTR(res_0, dstptr_0);

   _fx_catch_0: ;
      if (res_0) {
         _fx_free_Nt9Dynvec__t1N15K_form__kinfo_t(&res_0);
      }
      FX_FREE_ARR(&v_2);
      if (v_1) {
         _fx_free_Nt9Dynvec__t1N14Ast__id_info_t(&v_1);
      }
      if (dm_0) {
         _fx_free_N16Ast__defmodule_t(&dm_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_FREE_ARR(&_fx_g16K_form__all_idks);
   fx_copy_arr(&v_0, &_fx_g16K_form__all_idks);

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_0 = {0};
   _fx_N14K_form__kexp_t e_1 = 0;
   int fx_status = 0;
   FX_COPY_PTR(e_0, &e_1);
   for (;;) {
      _fx_N14K_form__kexp_t e_2 = 0;
      FX_COPY_PTR(e_1, &e_2);
      int tag_0 = FX_REC_VARIANT_TAG(e_2);
      if (tag_0 == 1) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_1 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpNop, &result_1);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_1, &result_0);
         FX_BREAK(_fx_catch_0);

      _fx_catch_0: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_1);
      }
      else if (tag_0 == 2) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_2 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpBreak, &result_2);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_2, &result_0);
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_2);
      }
      else if (tag_0 == 3) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_3 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpContinue, &result_3);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_3, &result_0);
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_3);
      }
      else if (tag_0 == 4) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_4 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpReturn.t1, &result_4);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_4, &result_0);
         FX_BREAK(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_4);
      }
      else if (tag_0 == 5) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_5 = &e_2->u.KExpAtom.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_5, &result_0);
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
      }
      else if (tag_0 == 6) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_6 = &e_2->u.KExpBinary.t3;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_6, &result_0);
         FX_BREAK(_fx_catch_5);

      _fx_catch_5: ;
      }
      else if (tag_0 == 7) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_7 = &e_2->u.KExpUnary.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_7, &result_0);
         FX_BREAK(_fx_catch_6);

      _fx_catch_6: ;
      }
      else if (tag_0 == 8) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_8 = &e_2->u.KExpIntrin.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_8, &result_0);
         FX_BREAK(_fx_catch_7);

      _fx_catch_7: ;
      }
      else if (tag_0 == 10) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_9 = &e_2->u.KExpSeq.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_9, &result_0);
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
      }
      else if (tag_0 == 9) {
         _fx_N14K_form__kexp_t* e_3 = &e_2->u.KExpSync.t1; _fx_free_N14K_form__kexp_t(&e_1); FX_COPY_PTR(*e_3, &e_1);
      }
      else if (tag_0 == 11) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_10 = &e_2->u.KExpIf.t3;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_10, &result_0);
         FX_BREAK(_fx_catch_9);

      _fx_catch_9: ;
      }
      else if (tag_0 == 12) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_11 = &e_2->u.KExpCall.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_11, &result_0);
         FX_BREAK(_fx_catch_10);

      _fx_catch_10: ;
      }
      else if (tag_0 == 13) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_12 = &e_2->u.KExpICall.t3;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_12, &result_0);
         FX_BREAK(_fx_catch_11);

      _fx_catch_11: ;
      }
      else if (tag_0 == 14) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_13 = &e_2->u.KExpMkTuple.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_13, &result_0);
         FX_BREAK(_fx_catch_12);

      _fx_catch_12: ;
      }
      else if (tag_0 == 15) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_14 = &e_2->u.KExpMkRecord.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_14, &result_0);
         FX_BREAK(_fx_catch_13);

      _fx_catch_13: ;
      }
      else if (tag_0 == 16) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_15 = &e_2->u.KExpMkClosure.t3;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_15, &result_0);
         FX_BREAK(_fx_catch_14);

      _fx_catch_14: ;
      }
      else if (tag_0 == 17) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_16 = &e_2->u.KExpMkArray.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_16, &result_0);
         FX_BREAK(_fx_catch_15);

      _fx_catch_15: ;
      }
      else if (tag_0 == 18) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_17 = &e_2->u.KExpMkVector.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_17, &result_0);
         FX_BREAK(_fx_catch_16);

      _fx_catch_16: ;
      }
      else if (tag_0 == 19) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_18 = &e_2->u.KExpAt.t4;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_18, &result_0);
         FX_BREAK(_fx_catch_17);

      _fx_catch_17: ;
      }
      else if (tag_0 == 20) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_19 = &e_2->u.KExpMem.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_19, &result_0);
         FX_BREAK(_fx_catch_18);

      _fx_catch_18: ;
      }
      else if (tag_0 == 21) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_20 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpAssign.t2, &result_20);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_20, &result_0);
         FX_BREAK(_fx_catch_19);

      _fx_catch_19: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_20);
      }
      else if (tag_0 == 22) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_21 = &e_2->u.KExpMatch.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_21, &result_0);
         FX_BREAK(_fx_catch_20);

      _fx_catch_20: ;
      }
      else if (tag_0 == 23) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_22 = &e_2->u.KExpTryCatch.t2;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_22, &result_0);
         FX_BREAK(_fx_catch_21);

      _fx_catch_21: ;
      }
      else if (tag_0 == 24) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_23 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g15K_form__KTypErr, &e_2->u.KExpThrow.t2, &result_23);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_23, &result_0);
         FX_BREAK(_fx_catch_22);

      _fx_catch_22: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_23);
      }
      else if (tag_0 == 25) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_24 = {0};
         _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* vcase_0 = &e_2->u.KExpCast;
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(vcase_0->t1, &vcase_0->t2, &result_24);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_24, &result_0);
         FX_BREAK(_fx_catch_23);

      _fx_catch_23: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_24);
      }
      else if (tag_0 == 26) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_25 = &e_2->u.KExpMap.t3;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_25, &result_0);
         FX_BREAK(_fx_catch_24);

      _fx_catch_24: ;
      }
      else if (tag_0 == 27) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_26 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpFor.t4, &result_26);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_26, &result_0);
         FX_BREAK(_fx_catch_25);

      _fx_catch_25: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_26);
      }
      else if (tag_0 == 28) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_27 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpWhile.t2, &result_27);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_27, &result_0);
         FX_BREAK(_fx_catch_26);

      _fx_catch_26: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_27);
      }
      else if (tag_0 == 29) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_28 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KExpDoWhile.t2, &result_28);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_28, &result_0);
         FX_BREAK(_fx_catch_27);

      _fx_catch_27: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_28);
      }
      else if (tag_0 == 30) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t* result_29 = &e_2->u.KExpCCode.t1;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(result_29, &result_0);
         FX_BREAK(_fx_catch_28);

      _fx_catch_28: ;
      }
      else if (tag_0 == 31) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_30 = {0};
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &e_2->u.KDefVal.t2, &result_30);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_30, &result_0);
         FX_BREAK(_fx_catch_29);

      _fx_catch_29: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_30);
      }
      else if (tag_0 == 32) {
         _fx_R17K_form__kdeffun_t v_0 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_31 = {0};
         _fx_copy_R17K_form__kdeffun_t(&e_2->u.KDefFun->data, &v_0);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_0.kf_loc, &result_31);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_31, &result_0);
         FX_BREAK(_fx_catch_30);

      _fx_catch_30: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_31);
         _fx_free_R17K_form__kdeffun_t(&v_0);
      }
      else if (tag_0 == 33) {
         _fx_R17K_form__kdefexn_t v_1 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_32 = {0};
         _fx_copy_R17K_form__kdefexn_t(&e_2->u.KDefExn->data, &v_1);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_1.ke_loc, &result_32);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_32, &result_0);
         FX_BREAK(_fx_catch_31);

      _fx_catch_31: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_32);
         _fx_free_R17K_form__kdefexn_t(&v_1);
      }
      else if (tag_0 == 34) {
         _fx_R21K_form__kdefvariant_t v_2 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_33 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&e_2->u.KDefVariant->data, &v_2);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_2.kvar_loc, &result_33);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_33, &result_0);
         FX_BREAK(_fx_catch_32);

      _fx_catch_32: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_33);
         _fx_free_R21K_form__kdefvariant_t(&v_2);
      }
      else if (tag_0 == 36) {
         _fx_R17K_form__kdeftyp_t v_3 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_34 = {0};
         _fx_copy_R17K_form__kdeftyp_t(&e_2->u.KDefTyp->data, &v_3);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_3.kt_loc, &result_34);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_34, &result_0);
         FX_BREAK(_fx_catch_33);

      _fx_catch_33: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_34);
         _fx_free_R17K_form__kdeftyp_t(&v_3);
      }
      else if (tag_0 == 35) {
         _fx_R23K_form__kdefinterface_t v_4 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_35 = {0};
         _fx_copy_R23K_form__kdefinterface_t(&e_2->u.KDefInterface->data, &v_4);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_4.ki_loc, &result_35);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_35, &result_0);
         FX_BREAK(_fx_catch_34);

      _fx_catch_34: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_35);
         _fx_free_R23K_form__kdefinterface_t(&v_4);
      }
      else if (tag_0 == 37) {
         _fx_R25K_form__kdefclosurevars_t v_5 = {0};
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t result_36 = {0};
         _fx_copy_R25K_form__kdefclosurevars_t(&e_2->u.KDefClosureVars->data, &v_5);
         _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(_fx_g16K_form__KTypVoid, &v_5.kcv_loc, &result_36);
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
         _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_36, &result_0);
         FX_BREAK(_fx_catch_35);

      _fx_catch_35: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_36);
         _fx_free_R25K_form__kdefclosurevars_t(&v_5);
      }
      else {
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_36);
      }
      FX_CHECK_EXN(_fx_catch_36);

   _fx_catch_36: ;
      if (e_2) {
         _fx_free_N14K_form__kexp_t(&e_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_copy_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0, fx_result);

_fx_cleanup: ;
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&result_0);
   if (e_1) {
      _fx_free_N14K_form__kexp_t(&e_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_kexp_typN14K_form__ktyp_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(e_0, &v_0, 0), _fx_cleanup);
   FX_COPY_PTR(v_0.t0, fx_result);

_fx_cleanup: ;
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_kexp_locR10Ast__loc_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(e_0, &v_0, 0), _fx_cleanup);
   *fx_result = v_0.t1;

_fx_cleanup: ;
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_kexp_endR10Ast__loc_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_0 = {0};
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(e_0, &v_0, 0), _fx_cleanup);
   _fx_R10Ast__loc_t v_1 = v_0.t1;
   FX_CALL(_fx_M3AstFM11get_end_locRM5loc_t1RM5loc_t(&v_1, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13is_val_globalB1R16Ast__val_flags_t(
   struct _fx_R16Ast__val_flags_t* flags_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_LN12Ast__scope_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(flags_0->val_flag_global, &v_0);
   *fx_result = v_0 != 0;
   FX_FREE_LIST_SIMPLE(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13get_val_scopeLN12Ast__scope_t1R16Ast__val_flags_t(
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_LN12Ast__scope_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN12Ast__scope_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(flags_0->val_flag_global, &v_0);
   if (v_0 == 0) {
      _fx_N12Ast__scope_t v_1;
      _fx_M3AstFM7ScBlockN12Ast__scope_t1i(0, &v_1);
      FX_CALL(_fx_cons_LN12Ast__scope_t(&v_1, 0, true, fx_result), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      FX_COPY_PTR(v_0, fx_result);
   }
   FX_FREE_LIST_SIMPLE(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM10get_kscopeLN12Ast__scope_t1N15K_form__kinfo_t(
   struct _fx_N15K_form__kinfo_t* info_0,
   struct _fx_LN12Ast__scope_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = info_0->tag;
   if (tag_0 != 1) {
      if (tag_0 == 2) {
         _fx_LN12Ast__scope_t v_0 = 0;
         FX_COPY_PTR(info_0->u.KVal.kv_flags.val_flag_global, &v_0);
         if (v_0 == 0) {
            _fx_N12Ast__scope_t v_1;
            _fx_M3AstFM7ScBlockN12Ast__scope_t1i(0, &v_1);
            FX_CALL(_fx_cons_LN12Ast__scope_t(&v_1, 0, true, fx_result), _fx_catch_0);

         _fx_catch_0: ;
         }
         else {
            FX_COPY_PTR(v_0, fx_result);
         }
         FX_CHECK_EXN(_fx_catch_1);

      _fx_catch_1: ;
         FX_FREE_LIST_SIMPLE(&v_0);
      }
      else if (tag_0 == 3) {
         _fx_R17K_form__kdeffun_t v_2 = {0};
         _fx_copy_R17K_form__kdeffun_t(&info_0->u.KFun->data, &v_2);
         FX_COPY_PTR(v_2.kf_scope, fx_result);
         _fx_free_R17K_form__kdeffun_t(&v_2);
      }
      else if (tag_0 == 4) {
         _fx_R17K_form__kdefexn_t v_3 = {0};
         _fx_copy_R17K_form__kdefexn_t(&info_0->u.KExn->data, &v_3);
         FX_COPY_PTR(v_3.ke_scope, fx_result);
         _fx_free_R17K_form__kdefexn_t(&v_3);
      }
      else if (tag_0 == 5) {
         _fx_R21K_form__kdefvariant_t v_4 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&info_0->u.KVariant->data, &v_4);
         FX_COPY_PTR(v_4.kvar_scope, fx_result);
         _fx_free_R21K_form__kdefvariant_t(&v_4);
      }
      else if (tag_0 == 7) {
         _fx_R23K_form__kdefinterface_t v_5 = {0};
         _fx_copy_R23K_form__kdefinterface_t(&info_0->u.KInterface->data, &v_5);
         FX_COPY_PTR(v_5.ki_scope, fx_result);
         _fx_free_R23K_form__kdefinterface_t(&v_5);
      }
      else if (tag_0 == 6) {
         _fx_R25K_form__kdefclosurevars_t v_6 = {0};
         _fx_copy_R25K_form__kdefclosurevars_t(&info_0->u.KClosureVars->data, &v_6);
         FX_COPY_PTR(v_6.kcv_scope, fx_result);
         _fx_free_R25K_form__kdefclosurevars_t(&v_6);
      }
      else if (tag_0 == 8) {
         _fx_R17K_form__kdeftyp_t v_7 = {0};
         _fx_copy_R17K_form__kdeftyp_t(&info_0->u.KTyp->data, &v_7);
         FX_COPY_PTR(v_7.kt_scope, fx_result);
         _fx_free_R17K_form__kdeftyp_t(&v_7);
      }
      else {
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
      }
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13get_idk_scopeLN12Ast__scope_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN12Ast__scope_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t v_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
   }
   else {
      _fx_Ta2i v_1;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_1, 0), _fx_cleanup);
      int_ m_0 = v_1.t0;
      int_ j_0 = v_1.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
   }
   int tag_0 = v_0.tag;
   if (tag_0 != 1) {
      if (tag_0 == 2) {
         _fx_LN12Ast__scope_t v_2 = 0;
         FX_COPY_PTR(v_0.u.KVal.kv_flags.val_flag_global, &v_2);
         if (v_2 == 0) {
            _fx_N12Ast__scope_t v_3;
            _fx_M3AstFM7ScBlockN12Ast__scope_t1i(0, &v_3);
            FX_CALL(_fx_cons_LN12Ast__scope_t(&v_3, 0, true, fx_result), _fx_catch_0);

         _fx_catch_0: ;
         }
         else {
            FX_COPY_PTR(v_2, fx_result);
         }
         FX_CHECK_EXN(_fx_catch_1);

      _fx_catch_1: ;
         FX_FREE_LIST_SIMPLE(&v_2);
      }
      else if (tag_0 == 3) {
         _fx_R17K_form__kdeffun_t v_4 = {0};
         _fx_copy_R17K_form__kdeffun_t(&v_0.u.KFun->data, &v_4);
         FX_COPY_PTR(v_4.kf_scope, fx_result);
         _fx_free_R17K_form__kdeffun_t(&v_4);
      }
      else if (tag_0 == 4) {
         _fx_R17K_form__kdefexn_t v_5 = {0};
         _fx_copy_R17K_form__kdefexn_t(&v_0.u.KExn->data, &v_5);
         FX_COPY_PTR(v_5.ke_scope, fx_result);
         _fx_free_R17K_form__kdefexn_t(&v_5);
      }
      else if (tag_0 == 5) {
         _fx_R21K_form__kdefvariant_t v_6 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&v_0.u.KVariant->data, &v_6);
         FX_COPY_PTR(v_6.kvar_scope, fx_result);
         _fx_free_R21K_form__kdefvariant_t(&v_6);
      }
      else if (tag_0 == 7) {
         _fx_R23K_form__kdefinterface_t v_7 = {0};
         _fx_copy_R23K_form__kdefinterface_t(&v_0.u.KInterface->data, &v_7);
         FX_COPY_PTR(v_7.ki_scope, fx_result);
         _fx_free_R23K_form__kdefinterface_t(&v_7);
      }
      else if (tag_0 == 6) {
         _fx_R25K_form__kdefclosurevars_t v_8 = {0};
         _fx_copy_R25K_form__kdefclosurevars_t(&v_0.u.KClosureVars->data, &v_8);
         FX_COPY_PTR(v_8.kcv_scope, fx_result);
         _fx_free_R25K_form__kdefclosurevars_t(&v_8);
      }
      else if (tag_0 == 8) {
         _fx_R17K_form__kdeftyp_t v_9 = {0};
         _fx_copy_R17K_form__kdeftyp_t(&v_0.u.KTyp->data, &v_9);
         FX_COPY_PTR(v_9.kt_scope, fx_result);
         _fx_free_R17K_form__kdeftyp_t(&v_9);
      }
      else {
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
      }
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM11get_idk_locR10Ast__loc_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t v_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
   }
   else {
      _fx_Ta2i v_1;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_1, 0), _fx_cleanup);
      int_ m_0 = v_1.t0;
      int_ j_0 = v_1.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
   }
   int tag_0 = v_0.tag;
   if (tag_0 == 1) {
      *fx_result = _fx_g10Ast__noloc;
   }
   else if (tag_0 == 2) {
      *fx_result = v_0.u.KVal.kv_loc;
   }
   else if (tag_0 == 3) {
      _fx_R17K_form__kdeffun_t v_2 = {0};
      _fx_copy_R17K_form__kdeffun_t(&v_0.u.KFun->data, &v_2);
      *fx_result = v_2.kf_loc;
      _fx_free_R17K_form__kdeffun_t(&v_2);
   }
   else if (tag_0 == 4) {
      _fx_R17K_form__kdefexn_t v_3 = {0};
      _fx_copy_R17K_form__kdefexn_t(&v_0.u.KExn->data, &v_3);
      *fx_result = v_3.ke_loc;
      _fx_free_R17K_form__kdefexn_t(&v_3);
   }
   else if (tag_0 == 5) {
      _fx_R21K_form__kdefvariant_t v_4 = {0};
      _fx_copy_R21K_form__kdefvariant_t(&v_0.u.KVariant->data, &v_4);
      *fx_result = v_4.kvar_loc;
      _fx_free_R21K_form__kdefvariant_t(&v_4);
   }
   else if (tag_0 == 8) {
      _fx_R17K_form__kdeftyp_t v_5 = {0};
      _fx_copy_R17K_form__kdeftyp_t(&v_0.u.KTyp->data, &v_5);
      *fx_result = v_5.kt_loc;
      _fx_free_R17K_form__kdeftyp_t(&v_5);
   }
   else if (tag_0 == 7) {
      _fx_R23K_form__kdefinterface_t v_6 = {0};
      _fx_copy_R23K_form__kdefinterface_t(&v_0.u.KInterface->data, &v_6);
      *fx_result = v_6.ki_loc;
      _fx_free_R23K_form__kdefinterface_t(&v_6);
   }
   else if (tag_0 == 6) {
      _fx_R25K_form__kdefclosurevars_t v_7 = {0};
      _fx_copy_R25K_form__kdefclosurevars_t(&v_0.u.KClosureVars->data, &v_7);
      *fx_result = v_7.kcv_loc;
      _fx_free_R25K_form__kdefclosurevars_t(&v_7);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM15get_kinfo_cnameS2N15K_form__kinfo_tR10Ast__loc_t(
   struct _fx_N15K_form__kinfo_t* info_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = info_0->tag;
   if (tag_0 == 1) {
      fx_exn_t v_0 = {0};
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request cname of uninitialized symbol");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_0, 0), _fx_catch_0);
      FX_THROW(&v_0, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_0);
   }
   else if (tag_0 == 2) {
      fx_copy_str(&info_0->u.KVal.kv_cname, fx_result);
   }
   else if (tag_0 == 3) {
      _fx_R17K_form__kdeffun_t v_1 = {0};
      _fx_copy_R17K_form__kdeffun_t(&info_0->u.KFun->data, &v_1);
      fx_copy_str(&v_1.kf_cname, fx_result);
      _fx_free_R17K_form__kdeffun_t(&v_1);
   }
   else if (tag_0 == 4) {
      _fx_R17K_form__kdefexn_t v_2 = {0};
      _fx_copy_R17K_form__kdefexn_t(&info_0->u.KExn->data, &v_2);
      fx_copy_str(&v_2.ke_cname, fx_result);
      _fx_free_R17K_form__kdefexn_t(&v_2);
   }
   else if (tag_0 == 5) {
      _fx_R21K_form__kdefvariant_t v_3 = {0};
      _fx_copy_R21K_form__kdefvariant_t(&info_0->u.KVariant->data, &v_3);
      fx_copy_str(&v_3.kvar_cname, fx_result);
      _fx_free_R21K_form__kdefvariant_t(&v_3);
   }
   else if (tag_0 == 7) {
      _fx_R23K_form__kdefinterface_t v_4 = {0};
      _fx_copy_R23K_form__kdefinterface_t(&info_0->u.KInterface->data, &v_4);
      fx_copy_str(&v_4.ki_cname, fx_result);
      _fx_free_R23K_form__kdefinterface_t(&v_4);
   }
   else if (tag_0 == 6) {
      _fx_R25K_form__kdefclosurevars_t v_5 = {0};
      _fx_copy_R25K_form__kdefclosurevars_t(&info_0->u.KClosureVars->data, &v_5);
      fx_copy_str(&v_5.kcv_cname, fx_result);
      _fx_free_R25K_form__kdefclosurevars_t(&v_5);
   }
   else if (tag_0 == 8) {
      _fx_R17K_form__kdeftyp_t v_6 = {0};
      _fx_copy_R17K_form__kdeftyp_t(&info_0->u.KTyp->data, &v_6);
      fx_copy_str(&v_6.kt_cname, fx_result);
      _fx_free_R17K_form__kdeftyp_t(&v_6);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13get_idk_cnameS2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t info_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
   }
   else {
      _fx_Ta2i v_0;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      int_ m_0 = v_0.t0;
      int_ j_0 = v_0.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
   }
   if (info_0.tag == 1) {
      fx_str_t v_1 = {0};
      fx_str_t v_2 = {0};
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
      fx_str_t slit_1 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_1, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
      FX_FREE_STR(&v_2);
      FX_FREE_STR(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   FX_CALL(_fx_M6K_formFM15get_kinfo_cnameS2N15K_form__kinfo_tR10Ast__loc_t(&info_0, loc_0, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&info_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t info_0 = {0};
   fx_str_t cname_0 = {0};
   _fx_N15K_form__kinfo_t v_0 = {0};
   _fx_LN12Ast__scope_t sc_0 = 0;
   fx_str_t v_1 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, fx_result, 0), _fx_cleanup);
   }
   else {
      if (n_0->m == 0) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
      }
      else {
         _fx_Ta2i v_2;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_2, 0), _fx_cleanup);
         int_ m_0 = v_2.t0;
         int_ j_0 = v_2.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_cleanup);
         _fx_copy_N15K_form__kinfo_t(
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
      }
      if (info_0.tag == 1) {
         fx_str_t v_3 = {0};
         fx_str_t v_4 = {0};
         fx_exn_t v_5 = {0};
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_3, 0), _fx_catch_0);
         fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
         fx_str_t slit_1 = FX_MAKE_STR("\'");
         {
            const fx_str_t strs_0[] = { slit_0, v_3, slit_1 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_4), _fx_catch_0);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_4, &v_5, 0), _fx_catch_0);
         FX_THROW(&v_5, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_5);
         FX_FREE_STR(&v_4);
         FX_FREE_STR(&v_3);
      }
      FX_CHECK_EXN(_fx_cleanup);
      FX_CALL(_fx_M6K_formFM15get_kinfo_cnameS2N15K_form__kinfo_tR10Ast__loc_t(&info_0, loc_0, &cname_0, 0), _fx_cleanup);
      if (FX_STR_LENGTH(cname_0) == 0) {
         if (n_0->m == 0) {
            _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
         }
         else {
            _fx_Ta2i v_6;
            FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_6, 0), _fx_cleanup);
            int_ m_1 = v_6.t0;
            int_ j_1 = v_6.t1;
            FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_1), _fx_cleanup);
            FX_CHKIDX(
               FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1, 0, j_1),
               _fx_cleanup);
            _fx_copy_N15K_form__kinfo_t(
               FX_PTR_1D(_fx_N15K_form__kinfo_t,
                  (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1, j_1), &v_0);
         }
         int tag_0 = v_0.tag;
         if (tag_0 != 1) {
            if (tag_0 == 2) {
               _fx_LN12Ast__scope_t v_7 = 0;
               FX_COPY_PTR(v_0.u.KVal.kv_flags.val_flag_global, &v_7);
               if (v_7 == 0) {
                  _fx_N12Ast__scope_t v_8;
                  _fx_M3AstFM7ScBlockN12Ast__scope_t1i(0, &v_8);
                  FX_CALL(_fx_cons_LN12Ast__scope_t(&v_8, 0, true, &sc_0), _fx_catch_1);

               _fx_catch_1: ;
               }
               else {
                  FX_COPY_PTR(v_7, &sc_0);
               }
               FX_CHECK_EXN(_fx_catch_2);

            _fx_catch_2: ;
               FX_FREE_LIST_SIMPLE(&v_7);
            }
            else if (tag_0 == 3) {
               _fx_R17K_form__kdeffun_t v_9 = {0};
               _fx_copy_R17K_form__kdeffun_t(&v_0.u.KFun->data, &v_9);
               FX_COPY_PTR(v_9.kf_scope, &sc_0);
               _fx_free_R17K_form__kdeffun_t(&v_9);
            }
            else if (tag_0 == 4) {
               _fx_R17K_form__kdefexn_t v_10 = {0};
               _fx_copy_R17K_form__kdefexn_t(&v_0.u.KExn->data, &v_10);
               FX_COPY_PTR(v_10.ke_scope, &sc_0);
               _fx_free_R17K_form__kdefexn_t(&v_10);
            }
            else if (tag_0 == 5) {
               _fx_R21K_form__kdefvariant_t v_11 = {0};
               _fx_copy_R21K_form__kdefvariant_t(&v_0.u.KVariant->data, &v_11);
               FX_COPY_PTR(v_11.kvar_scope, &sc_0);
               _fx_free_R21K_form__kdefvariant_t(&v_11);
            }
            else if (tag_0 == 7) {
               _fx_R23K_form__kdefinterface_t v_12 = {0};
               _fx_copy_R23K_form__kdefinterface_t(&v_0.u.KInterface->data, &v_12);
               FX_COPY_PTR(v_12.ki_scope, &sc_0);
               _fx_free_R23K_form__kdefinterface_t(&v_12);
            }
            else if (tag_0 == 6) {
               _fx_R25K_form__kdefclosurevars_t v_13 = {0};
               _fx_copy_R25K_form__kdefclosurevars_t(&v_0.u.KClosureVars->data, &v_13);
               FX_COPY_PTR(v_13.kcv_scope, &sc_0);
               _fx_free_R25K_form__kdefclosurevars_t(&v_13);
            }
            else if (tag_0 == 8) {
               _fx_R17K_form__kdeftyp_t v_14 = {0};
               _fx_copy_R17K_form__kdeftyp_t(&v_0.u.KTyp->data, &v_14);
               FX_COPY_PTR(v_14.kt_scope, &sc_0);
               _fx_free_R17K_form__kdeftyp_t(&v_14);
            }
            else {
               FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
            }
         }
         FX_CHECK_EXN(_fx_cleanup);
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_cleanup);
         FX_CALL(_fx_M3AstFM18get_qualified_nameS2SLN12Ast__scope_t(&v_1, sc_0, fx_result, 0), _fx_cleanup);
      }
      else {
         fx_copy_str(&cname_0, fx_result);
      }
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&info_0);
   FX_FREE_STR(&cname_0);
   _fx_free_N15K_form__kinfo_t(&v_0);
   FX_FREE_LIST_SIMPLE(&sc_0);
   FX_FREE_STR(&v_1);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM10get_kf_typN14K_form__ktyp_t3LR9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_LR9Ast__id_t_data_t* kf_params_0,
   struct _fx_N14K_form__ktyp_t_data_t* kf_rt_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__ktyp_t v_0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__ktyp_t lstend_0 = 0;
   _fx_LR9Ast__id_t lst_0 = kf_params_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N15K_form__kinfo_t info_0 = {0};
      _fx_R17K_form__kdefval_t v_1 = {0};
      _fx_R9Ast__id_t* a_0 = &lst_0->hd;
      if (a_0->m == 0) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
      }
      else {
         _fx_Ta2i v_2;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(a_0, loc_0, &v_2, 0), _fx_catch_2);
         int_ m_0 = v_2.t0;
         int_ j_0 = v_2.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_2);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_catch_2);
         _fx_copy_N15K_form__kinfo_t(
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
      }
      if (info_0.tag == 1) {
         fx_str_t v_3 = {0};
         fx_str_t v_4 = {0};
         fx_exn_t v_5 = {0};
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(a_0, &v_3, 0), _fx_catch_0);
         fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
         fx_str_t slit_1 = FX_MAKE_STR("\'");
         {
            const fx_str_t strs_0[] = { slit_0, v_3, slit_1 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_4), _fx_catch_0);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_4, &v_5, 0), _fx_catch_0);
         FX_THROW(&v_5, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_5);
         FX_FREE_STR(&v_4);
         FX_FREE_STR(&v_3);
      }
      FX_CHECK_EXN(_fx_catch_2);
      if (info_0.tag == 2) {
         _fx_copy_R17K_form__kdefval_t(&info_0.u.KVal, &v_1);
      }
      else {
         fx_str_t v_6 = {0};
         fx_str_t v_7 = {0};
         fx_exn_t v_8 = {0};
         bool __fold_result___0 = true;
         bool t_0;
         if (loc_0->m_idx == _fx_g10Ast__noloc.m_idx) {
            t_0 = __fold_result___0;
         }
         else {
            t_0 = false;
         }
         __fold_result___0 = t_0;
         bool t_1;
         if (loc_0->line0 == _fx_g10Ast__noloc.line0) {
            t_1 = __fold_result___0;
         }
         else {
            t_1 = false;
         }
         __fold_result___0 = t_1;
         bool t_2;
         if (loc_0->col0 == _fx_g10Ast__noloc.col0) {
            t_2 = __fold_result___0;
         }
         else {
            t_2 = false;
         }
         __fold_result___0 = t_2;
         bool t_3;
         if (loc_0->line1 == _fx_g10Ast__noloc.line1) {
            t_3 = __fold_result___0;
         }
         else {
            t_3 = false;
         }
         __fold_result___0 = t_3;
         bool t_4;
         if (loc_0->col1 == _fx_g10Ast__noloc.col1) {
            t_4 = __fold_result___0;
         }
         else {
            t_4 = false;
         }
         __fold_result___0 = t_4;
         _fx_R10Ast__loc_t loc_1;
         if (!__fold_result___0) {
            loc_1 = *loc_0;
         }
         else {
            int tag_0 = info_0.tag;
            if (tag_0 == 1) {
               loc_1 = _fx_g10Ast__noloc;
            }
            else if (tag_0 == 2) {
               loc_1 = info_0.u.KVal.kv_loc;
            }
            else if (tag_0 == 3) {
               _fx_R17K_form__kdeffun_t v_9 = {0};
               _fx_copy_R17K_form__kdeffun_t(&info_0.u.KFun->data, &v_9);
               loc_1 = v_9.kf_loc;
               _fx_free_R17K_form__kdeffun_t(&v_9);
            }
            else if (tag_0 == 4) {
               _fx_R17K_form__kdefexn_t v_10 = {0};
               _fx_copy_R17K_form__kdefexn_t(&info_0.u.KExn->data, &v_10);
               loc_1 = v_10.ke_loc;
               _fx_free_R17K_form__kdefexn_t(&v_10);
            }
            else if (tag_0 == 5) {
               _fx_R21K_form__kdefvariant_t v_11 = {0};
               _fx_copy_R21K_form__kdefvariant_t(&info_0.u.KVariant->data, &v_11);
               loc_1 = v_11.kvar_loc;
               _fx_free_R21K_form__kdefvariant_t(&v_11);
            }
            else if (tag_0 == 8) {
               _fx_R17K_form__kdeftyp_t v_12 = {0};
               _fx_copy_R17K_form__kdeftyp_t(&info_0.u.KTyp->data, &v_12);
               loc_1 = v_12.kt_loc;
               _fx_free_R17K_form__kdeftyp_t(&v_12);
            }
            else if (tag_0 == 7) {
               _fx_R23K_form__kdefinterface_t v_13 = {0};
               _fx_copy_R23K_form__kdefinterface_t(&info_0.u.KInterface->data, &v_13);
               loc_1 = v_13.ki_loc;
               _fx_free_R23K_form__kdefinterface_t(&v_13);
            }
            else if (tag_0 == 6) {
               _fx_R25K_form__kdefclosurevars_t v_14 = {0};
               _fx_copy_R25K_form__kdefclosurevars_t(&info_0.u.KClosureVars->data, &v_14);
               loc_1 = v_14.kcv_loc;
               _fx_free_R25K_form__kdefclosurevars_t(&v_14);
            }
            else {
               FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_1);
            }
            FX_CHECK_EXN(_fx_catch_1);
         }
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(a_0, &v_6, 0), _fx_catch_1);
         fx_str_t slit_2 = FX_MAKE_STR("symbol \'");
         fx_str_t slit_3 = FX_MAKE_STR("\' is expected to be KVal ...");
         {
            const fx_str_t strs_1[] = { slit_2, v_6, slit_3 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_7), _fx_catch_1);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_1, &v_7, &v_8, 0), _fx_catch_1);
         FX_THROW(&v_8, false, _fx_catch_1);

      _fx_catch_1: ;
         fx_free_exn(&v_8);
         FX_FREE_STR(&v_7);
         FX_FREE_STR(&v_6);
      }
      FX_CHECK_EXN(_fx_catch_2);
      _fx_LN14K_form__ktyp_t node_0 = 0;
      FX_CALL(_fx_cons_LN14K_form__ktyp_t(v_1.kv_typ, 0, false, &node_0), _fx_catch_2);
      FX_LIST_APPEND(v_0, lstend_0, node_0);

   _fx_catch_2: ;
      _fx_free_R17K_form__kdefval_t(&v_1);
      _fx_free_N15K_form__kinfo_t(&info_0);
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_CALL(_fx_M6K_formFM7KTypFunN14K_form__ktyp_t2LN14K_form__ktyp_tN14K_form__ktyp_t(v_0, kf_rt_0, fx_result), _fx_cleanup);

_fx_cleanup: ;
   if (v_0) {
      _fx_free_LN14K_form__ktyp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13get_kinfo_typN14K_form__ktyp_t3N15K_form__kinfo_tR9Ast__id_tR10Ast__loc_t(
   struct _fx_N15K_form__kinfo_t* info_0,
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_R17K_form__kdeftyp_t v_0 = {0};
   int fx_status = 0;
   if (info_0->tag == 1) {
      fx_str_t v_1 = {0};
      fx_str_t v_2 = {0};
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
      fx_str_t slit_1 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_1, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
      FX_FREE_STR(&v_2);
      FX_FREE_STR(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   int tag_0 = info_0->tag;
   if (tag_0 == 1) {
      FX_COPY_PTR(_fx_g16K_form__KTypVoid, fx_result); goto _fx_endmatch_0;
   }
   if (tag_0 == 2) {
      FX_COPY_PTR(info_0->u.KVal.kv_typ, fx_result); goto _fx_endmatch_0;
   }
   if (tag_0 == 3) {
      _fx_R17K_form__kdeffun_t v_4 = {0};
      _fx_copy_R17K_form__kdeffun_t(&info_0->u.KFun->data, &v_4);
      FX_CALL(
         _fx_M6K_formFM10get_kf_typN14K_form__ktyp_t3LR9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(v_4.kf_params, v_4.kf_rt,
            &v_4.kf_loc, fx_result, 0), _fx_catch_1);

   _fx_catch_1: ;
      _fx_free_R17K_form__kdeffun_t(&v_4);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 4) {
      FX_COPY_PTR(_fx_g15K_form__KTypExn, fx_result); goto _fx_endmatch_0;
   }
   if (tag_0 == 5) {
      _fx_R21K_form__kdefvariant_t v_5 = {0};
      _fx_copy_R21K_form__kdefvariant_t(&info_0->u.KVariant->data, &v_5);
      FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(&v_5.kvar_name, fx_result), _fx_catch_2);

   _fx_catch_2: ;
      _fx_free_R21K_form__kdefvariant_t(&v_5);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 7) {
      _fx_R23K_form__kdefinterface_t v_6 = {0};
      _fx_copy_R23K_form__kdefinterface_t(&info_0->u.KInterface->data, &v_6);
      FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(&v_6.ki_name, fx_result), _fx_catch_3);

   _fx_catch_3: ;
      _fx_free_R23K_form__kdefinterface_t(&v_6);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 6) {
      _fx_R25K_form__kdefclosurevars_t v_7 = {0};
      _fx_copy_R25K_form__kdefclosurevars_t(&info_0->u.KClosureVars->data, &v_7);
      FX_CALL(
         _fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(&v_7.kcv_name, v_7.kcv_freevars,
            fx_result), _fx_catch_4);

   _fx_catch_4: ;
      _fx_free_R25K_form__kdefclosurevars_t(&v_7);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 8) {
      _fx_copy_R17K_form__kdeftyp_t(&info_0->u.KTyp->data, &v_0);
      _fx_N14K_form__ktyp_t kt_typ_0 = v_0.kt_typ;
      if (FX_REC_VARIANT_TAG(kt_typ_0) == 15) {
         FX_COPY_PTR(kt_typ_0, fx_result); goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 8) {
      _fx_R17K_form__kdeftyp_t v_8 = {0};
      _fx_copy_R17K_form__kdeftyp_t(&info_0->u.KTyp->data, &v_8);
      FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(&v_8.kt_name, fx_result), _fx_catch_5);

   _fx_catch_5: ;
      _fx_free_R17K_form__kdeftyp_t(&v_8);
      goto _fx_endmatch_0;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_R17K_form__kdeftyp_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_idk_ktypN14K_form__ktyp_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t v_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
   }
   else {
      _fx_Ta2i v_1;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_1, 0), _fx_cleanup);
      int_ m_0 = v_1.t0;
      int_ j_0 = v_1.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
   }
   FX_CALL(
      _fx_M6K_formFM13get_kinfo_typN14K_form__ktyp_t3N15K_form__kinfo_tR9Ast__id_tR10Ast__loc_t(&v_0, n_0, loc_0, fx_result, 0),
      _fx_cleanup);

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13get_atom_ktypN14K_form__ktyp_t2N14K_form__atom_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = a_0->tag;
   if (tag_0 == 1) {
      _fx_N15K_form__kinfo_t v_0 = {0};
      _fx_R9Ast__id_t* n_0 = &a_0->u.AtomId;
      if (n_0->m == 0) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
      }
      else {
         _fx_Ta2i v_1;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_1, 0), _fx_catch_0);
         int_ m_0 = v_1.t0;
         int_ j_0 = v_1.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_0);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_catch_0);
         _fx_copy_N15K_form__kinfo_t(
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
      }
      FX_CALL(
         _fx_M6K_formFM13get_kinfo_typN14K_form__ktyp_t3N15K_form__kinfo_tR9Ast__id_tR10Ast__loc_t(&v_0, n_0, loc_0, fx_result,
            0), _fx_catch_0);

   _fx_catch_0: ;
      _fx_free_N15K_form__kinfo_t(&v_0);
   }
   else if (tag_0 == 2) {
      _fx_N14K_form__klit_t* l_0 = &a_0->u.AtomLit;
      int tag_1 = l_0->tag;
      if (tag_1 == 1) {
         FX_COPY_PTR(_fx_g15K_form__KTypInt, fx_result);
      }
      else if (tag_1 == 2) {
         FX_CALL(_fx_M6K_formFM8KTypSIntN14K_form__ktyp_t1i(l_0->u.KLitSInt.t0, fx_result), _fx_catch_1);  _fx_catch_1: ;
      }
      else if (tag_1 == 3) {
         FX_CALL(_fx_M6K_formFM8KTypUIntN14K_form__ktyp_t1i(l_0->u.KLitUInt.t0, fx_result), _fx_catch_2);  _fx_catch_2: ;
      }
      else if (tag_1 == 4) {
         FX_CALL(_fx_M6K_formFM9KTypFloatN14K_form__ktyp_t1i(l_0->u.KLitFloat.t0, fx_result), _fx_catch_3);  _fx_catch_3: ;
      }
      else if (tag_1 == 5) {
         FX_COPY_PTR(_fx_g18K_form__KTypString, fx_result);
      }
      else if (tag_1 == 6) {
         FX_COPY_PTR(_fx_g16K_form__KTypChar, fx_result);
      }
      else if (tag_1 == 7) {
         FX_COPY_PTR(_fx_g16K_form__KTypBool, fx_result);
      }
      else if (tag_1 == 8) {
         FX_COPY_PTR(l_0->u.KLitNil, fx_result);
      }
      else {
         FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_4);
      }
      FX_CHECK_EXN(_fx_catch_4);

   _fx_catch_4: ;
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9code2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t v_0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__kexp_t lstend_0 = 0;
   _fx_LN14K_form__kexp_t lst_0 = code_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N14K_form__kexp_t x_0 = lst_0->hd;
      bool res_0;
      if (FX_REC_VARIANT_TAG(x_0) == 1) {
         res_0 = false;
      }
      else {
         res_0 = true;
      }
      FX_CHECK_EXN(_fx_catch_0);
      if (!res_0) {
         FX_CONTINUE(_fx_catch_0);
      }
      _fx_LN14K_form__kexp_t node_0 = 0;
      FX_CALL(_fx_cons_LN14K_form__kexp_t(x_0, 0, false, &node_0), _fx_catch_0);
      FX_LIST_APPEND(v_0, lstend_0, node_0);

   _fx_catch_0: ;
      FX_CHECK_CONTINUE();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (v_0 == 0) {
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(loc_0, fx_result), _fx_catch_1);

   _fx_catch_1: ;
      goto _fx_endmatch_1;
   }
   if (v_0 != 0) {
      if (v_0->tl == 0) {
         FX_COPY_PTR(v_0->hd, fx_result); goto _fx_endmatch_1;
      }
   }
   _fx_N14K_form__kexp_t result_0 = 0;
   _fx_LN14K_form__kexp_t __pat___0 = 0;
   _fx_N14K_form__kexp_t v_1 = 0;
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_2 = {0};
   _fx_N14K_form__ktyp_t t_0 = 0;
   _fx_LR10Ast__loc_t v_3 = 0;
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_4 = {0};
   FX_COPY_PTR(code_0, &__pat___0);
   for (;;) {
      _fx_LN14K_form__kexp_t __pat___1 = 0;
      FX_COPY_PTR(__pat___0, &__pat___1);
      if (__pat___1 != 0) {
         if (__pat___1->tl == 0) {
            _fx_N14K_form__kexp_t result_1 = 0;
            FX_COPY_PTR(__pat___1->hd, &result_1);
            _fx_free_N14K_form__kexp_t(&result_0);
            FX_COPY_PTR(result_1, &result_0);
            FX_BREAK(_fx_catch_2);

         _fx_catch_2: ;
            if (result_1) {
               _fx_free_N14K_form__kexp_t(&result_1);
            }
            goto _fx_endmatch_0;
         }
      }
      if (__pat___1 != 0) {
         _fx_LN14K_form__kexp_t* rest_0 = &__pat___1->tl;
         _fx_free_LN14K_form__kexp_t(&__pat___0);
         FX_COPY_PTR(*rest_0, &__pat___0);
         goto _fx_endmatch_0;
      }
      FX_FAST_THROW(FX_EXN_NullListError, _fx_catch_3);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      if (__pat___1) {
         _fx_free_LN14K_form__kexp_t(&__pat___1);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_catch_5);
   }
   FX_COPY_PTR(result_0, &v_1);
   FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(v_1, &v_2, 0), _fx_catch_5);
   FX_COPY_PTR(v_2.t0, &t_0);
   _fx_LR10Ast__loc_t lstend_1 = 0;
   _fx_LN14K_form__kexp_t lst_1 = code_0;
   for (; lst_1; lst_1 = lst_1->tl) {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_5 = {0};
      _fx_N14K_form__kexp_t x_1 = lst_1->hd;
      FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(x_1, &v_5, 0), _fx_catch_4);
      _fx_LR10Ast__loc_t node_1 = 0;
      FX_CALL(_fx_cons_LR10Ast__loc_t(&v_5.t1, 0, false, &node_1), _fx_catch_4);
      FX_LIST_APPEND(v_3, lstend_1, node_1);

   _fx_catch_4: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_5);
      FX_CHECK_EXN(_fx_catch_5);
   }
   _fx_R10Ast__loc_t final_loc_0;
   FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(v_3, loc_0, &final_loc_0, 0), _fx_catch_5);
   _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_0, &final_loc_0, &v_4);
   FX_CALL(_fx_M6K_formFM7KExpSeqN14K_form__kexp_t2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(code_0, &v_4, fx_result),
      _fx_catch_5);

_fx_catch_5: ;
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_4);
   FX_FREE_LIST_SIMPLE(&v_3);
   if (t_0) {
      _fx_free_N14K_form__ktyp_t(&t_0);
   }
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_2);
   if (v_1) {
      _fx_free_N14K_form__kexp_t(&v_1);
   }
   if (__pat___0) {
      _fx_free_LN14K_form__kexp_t(&__pat___0);
   }
   if (result_0) {
      _fx_free_N14K_form__kexp_t(&result_0);
   }

_fx_endmatch_1: ;

_fx_cleanup: ;
   if (v_0) {
      _fx_free_LN14K_form__kexp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM10rcode2kexpN14K_form__kexp_t2LN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t v_0 = 0;
   int fx_status = 0;
   _fx_LN14K_form__kexp_t lstend_0 = 0;
   _fx_LN14K_form__kexp_t lst_0 = code_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N14K_form__kexp_t x_0 = lst_0->hd;
      bool res_0;
      if (FX_REC_VARIANT_TAG(x_0) == 1) {
         res_0 = false;
      }
      else {
         res_0 = true;
      }
      FX_CHECK_EXN(_fx_catch_0);
      if (!res_0) {
         FX_CONTINUE(_fx_catch_0);
      }
      _fx_LN14K_form__kexp_t node_0 = 0;
      FX_CALL(_fx_cons_LN14K_form__kexp_t(x_0, 0, false, &node_0), _fx_catch_0);
      FX_LIST_APPEND(v_0, lstend_0, node_0);

   _fx_catch_0: ;
      FX_CHECK_CONTINUE();
      FX_CHECK_EXN(_fx_cleanup);
   }
   if (v_0 == 0) {
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(loc_0, fx_result), _fx_catch_1);

   _fx_catch_1: ;
      goto _fx_endmatch_0;
   }
   if (v_0 != 0) {
      if (v_0->tl == 0) {
         FX_COPY_PTR(v_0->hd, fx_result); goto _fx_endmatch_0;
      }
   }
   if (v_0 != 0) {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_1 = {0};
      _fx_N14K_form__ktyp_t t_0 = 0;
      _fx_LR10Ast__loc_t v_2 = 0;
      _fx_LN14K_form__kexp_t __fold_result___0 = 0;
      _fx_LN14K_form__kexp_t v_3 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_4 = {0};
      FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(v_0->hd, &v_1, 0), _fx_catch_4);
      FX_COPY_PTR(v_1.t0, &t_0);
      _fx_LR10Ast__loc_t lstend_1 = 0;
      _fx_LN14K_form__kexp_t lst_1 = code_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_5 = {0};
         _fx_N14K_form__kexp_t x_1 = lst_1->hd;
         FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(x_1, &v_5, 0), _fx_catch_2);
         _fx_LR10Ast__loc_t node_1 = 0;
         FX_CALL(_fx_cons_LR10Ast__loc_t(&v_5.t1, 0, false, &node_1), _fx_catch_2);
         FX_LIST_APPEND(v_2, lstend_1, node_1);

      _fx_catch_2: ;
         _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_5);
         FX_CHECK_EXN(_fx_catch_4);
      }
      _fx_R10Ast__loc_t final_loc_0;
      FX_CALL(_fx_M3AstFM11loclist2locRM5loc_t2LRM5loc_tRM5loc_t(v_2, loc_0, &final_loc_0, 0), _fx_catch_4);
      _fx_LN14K_form__kexp_t lst_2 = code_0;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_LN14K_form__kexp_t r_0 = 0;
         _fx_N14K_form__kexp_t a_0 = lst_2->hd;
         FX_COPY_PTR(__fold_result___0, &r_0);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(a_0, r_0, false, &r_0), _fx_catch_3);
         _fx_free_LN14K_form__kexp_t(&__fold_result___0);
         FX_COPY_PTR(r_0, &__fold_result___0);

      _fx_catch_3: ;
         if (r_0) {
            _fx_free_LN14K_form__kexp_t(&r_0);
         }
         FX_CHECK_EXN(_fx_catch_4);
      }
      FX_COPY_PTR(__fold_result___0, &v_3);
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(t_0, &final_loc_0, &v_4);
      FX_CALL(_fx_M6K_formFM7KExpSeqN14K_form__kexp_t2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(v_3, &v_4, fx_result),
         _fx_catch_4);

   _fx_catch_4: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_4);
      if (v_3) {
         _fx_free_LN14K_form__kexp_t(&v_3);
      }
      if (__fold_result___0) {
         _fx_free_LN14K_form__kexp_t(&__fold_result___0);
      }
      FX_FREE_LIST_SIMPLE(&v_2);
      if (t_0) {
         _fx_free_N14K_form__ktyp_t(&t_0);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_1);
      goto _fx_endmatch_0;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (v_0) {
      _fx_free_LN14K_form__kexp_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9kexp2codeLN14K_form__kexp_t1N14K_form__kexp_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = FX_REC_VARIANT_TAG(e_0);
   if (tag_0 != 1) {
      if (tag_0 == 10) {
         FX_COPY_PTR(e_0->u.KExpSeq.t0, fx_result);
      }
      else {
         FX_CALL(_fx_cons_LN14K_form__kexp_t(e_0, 0, true, fx_result), _fx_catch_0);  _fx_catch_0: ;
      }
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__kdefval_t* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t info_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
   }
   else {
      _fx_Ta2i v_0;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      int_ m_0 = v_0.t0;
      int_ j_0 = v_0.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
   }
   if (info_0.tag == 1) {
      fx_str_t v_1 = {0};
      fx_str_t v_2 = {0};
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
      fx_str_t slit_1 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_1, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
      FX_FREE_STR(&v_2);
      FX_FREE_STR(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (info_0.tag == 2) {
      _fx_copy_R17K_form__kdefval_t(&info_0.u.KVal, fx_result);
   }
   else {
      fx_str_t v_4 = {0};
      fx_str_t v_5 = {0};
      fx_exn_t v_6 = {0};
      bool __fold_result___0 = true;
      bool t_0;
      if (loc_0->m_idx == _fx_g10Ast__noloc.m_idx) {
         t_0 = __fold_result___0;
      }
      else {
         t_0 = false;
      }
      __fold_result___0 = t_0;
      bool t_1;
      if (loc_0->line0 == _fx_g10Ast__noloc.line0) {
         t_1 = __fold_result___0;
      }
      else {
         t_1 = false;
      }
      __fold_result___0 = t_1;
      bool t_2;
      if (loc_0->col0 == _fx_g10Ast__noloc.col0) {
         t_2 = __fold_result___0;
      }
      else {
         t_2 = false;
      }
      __fold_result___0 = t_2;
      bool t_3;
      if (loc_0->line1 == _fx_g10Ast__noloc.line1) {
         t_3 = __fold_result___0;
      }
      else {
         t_3 = false;
      }
      __fold_result___0 = t_3;
      bool t_4;
      if (loc_0->col1 == _fx_g10Ast__noloc.col1) {
         t_4 = __fold_result___0;
      }
      else {
         t_4 = false;
      }
      __fold_result___0 = t_4;
      _fx_R10Ast__loc_t loc_1;
      if (!__fold_result___0) {
         loc_1 = *loc_0;
      }
      else {
         int tag_0 = info_0.tag;
         if (tag_0 == 1) {
            loc_1 = _fx_g10Ast__noloc;
         }
         else if (tag_0 == 2) {
            loc_1 = info_0.u.KVal.kv_loc;
         }
         else if (tag_0 == 3) {
            _fx_R17K_form__kdeffun_t v_7 = {0};
            _fx_copy_R17K_form__kdeffun_t(&info_0.u.KFun->data, &v_7);
            loc_1 = v_7.kf_loc;
            _fx_free_R17K_form__kdeffun_t(&v_7);
         }
         else if (tag_0 == 4) {
            _fx_R17K_form__kdefexn_t v_8 = {0};
            _fx_copy_R17K_form__kdefexn_t(&info_0.u.KExn->data, &v_8);
            loc_1 = v_8.ke_loc;
            _fx_free_R17K_form__kdefexn_t(&v_8);
         }
         else if (tag_0 == 5) {
            _fx_R21K_form__kdefvariant_t v_9 = {0};
            _fx_copy_R21K_form__kdefvariant_t(&info_0.u.KVariant->data, &v_9);
            loc_1 = v_9.kvar_loc;
            _fx_free_R21K_form__kdefvariant_t(&v_9);
         }
         else if (tag_0 == 8) {
            _fx_R17K_form__kdeftyp_t v_10 = {0};
            _fx_copy_R17K_form__kdeftyp_t(&info_0.u.KTyp->data, &v_10);
            loc_1 = v_10.kt_loc;
            _fx_free_R17K_form__kdeftyp_t(&v_10);
         }
         else if (tag_0 == 7) {
            _fx_R23K_form__kdefinterface_t v_11 = {0};
            _fx_copy_R23K_form__kdefinterface_t(&info_0.u.KInterface->data, &v_11);
            loc_1 = v_11.ki_loc;
            _fx_free_R23K_form__kdefinterface_t(&v_11);
         }
         else if (tag_0 == 6) {
            _fx_R25K_form__kdefclosurevars_t v_12 = {0};
            _fx_copy_R25K_form__kdefclosurevars_t(&info_0.u.KClosureVars->data, &v_12);
            loc_1 = v_12.kcv_loc;
            _fx_free_R25K_form__kdefclosurevars_t(&v_12);
         }
         else {
            FX_FAST_THROW(FX_EXN_NoMatchError, _fx_catch_1);
         }
         FX_CHECK_EXN(_fx_catch_1);
      }
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_4, 0), _fx_catch_1);
      fx_str_t slit_2 = FX_MAKE_STR("symbol \'");
      fx_str_t slit_3 = FX_MAKE_STR("\' is expected to be KVal ...");
      {
         const fx_str_t strs_1[] = { slit_2, v_4, slit_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_5), _fx_catch_1);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_1, &v_5, &v_6, 0), _fx_catch_1);
      FX_THROW(&v_6, false, _fx_catch_1);

   _fx_catch_1: ;
      fx_free_exn(&v_6);
      FX_FREE_STR(&v_5);
      FX_FREE_STR(&v_4);
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&info_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM12get_kvariantrRM13kdefvariant_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_rR21K_form__kdefvariant_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t t_1 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(t_0, loc_0, &t_1, 0), _fx_cleanup);
   if (FX_REC_VARIANT_TAG(t_1) == 16) {
      _fx_N15K_form__kinfo_t v_0 = {0};
      _fx_R9Ast__id_t* tn_0 = &t_1->u.KTypName;
      if (tn_0->m == 0) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
      }
      else {
         _fx_Ta2i v_1;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(tn_0, loc_0, &v_1, 0), _fx_catch_1);
         int_ m_0 = v_1.t0;
         int_ j_0 = v_1.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_1);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_catch_1);
         _fx_copy_N15K_form__kinfo_t(
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
      }
      if (v_0.tag == 5) {
         FX_COPY_PTR(v_0.u.KVariant, fx_result);
      }
      else {
         fx_str_t v_2 = {0};
         fx_str_t v_3 = {0};
         fx_exn_t v_4 = {0};
         FX_CALL(_fx_M3AstFM6stringS1RM4id_t(tn_0, &v_2, 0), _fx_catch_0);
         fx_str_t slit_0 = FX_MAKE_STR("type \'");
         fx_str_t slit_1 = FX_MAKE_STR("\' is expected to be a variant");
         {
            const fx_str_t strs_0[] = { slit_0, v_2, slit_1 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_3), _fx_catch_0);
         }
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_3, &v_4, 0), _fx_catch_0);
         FX_THROW(&v_4, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_4);
         FX_FREE_STR(&v_3);
         FX_FREE_STR(&v_2);
      }
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
      _fx_free_N15K_form__kinfo_t(&v_0);
   }
   else {
      fx_exn_t v_5 = {0};
      fx_str_t slit_2 = FX_MAKE_STR("variant (or sometimes an exception) is expected here");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_5, 0), _fx_catch_2);
      FX_THROW(&v_5, false, _fx_catch_2);

   _fx_catch_2: ;
      fx_free_exn(&v_5);
   }

_fx_cleanup: ;
   if (t_1) {
      _fx_free_N14K_form__ktyp_t(&t_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM18get_kinterface_optNt6option1rRM15kdefinterface_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_Nt6option1rR23K_form__kdefinterface_t* fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t t_1 = 0;
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(t_0, loc_0, &t_1, 0), _fx_cleanup);
   if (FX_REC_VARIANT_TAG(t_1) == 16) {
      _fx_N15K_form__kinfo_t v_0 = {0};
      _fx_R9Ast__id_t* tn_0 = &t_1->u.KTypName;
      if (tn_0->m == 0) {
         _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
      }
      else {
         _fx_Ta2i v_1;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(tn_0, loc_0, &v_1, 0), _fx_catch_0);
         int_ m_0 = v_1.t0;
         int_ j_0 = v_1.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_0);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_catch_0);
         _fx_copy_N15K_form__kinfo_t(
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
      }
      if (v_0.tag == 7) {
         _fx_M6K_formFM4SomeNt6option1rRM15kdefinterface_t1rRM15kdefinterface_t(v_0.u.KInterface, fx_result);
      }
      else {
         _fx_copy_Nt6option1rR23K_form__kdefinterface_t(&_fx_g12K_form__None, fx_result);
      }
      FX_CHECK_EXN(_fx_catch_0);

   _fx_catch_0: ;
      _fx_free_N15K_form__kinfo_t(&v_0);
   }
   else {
      _fx_copy_Nt6option1rR23K_form__kdefinterface_t(&_fx_g12K_form__None, fx_result);
   }

_fx_cleanup: ;
   if (t_1) {
      _fx_free_N14K_form__ktyp_t(&t_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(callb_0->kcb_ktyp, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(t_0, loc_0, callb_0, fx_result, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      FX_CALL(
         _fx_M6K_formFM9walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_0, loc_0, callb_0, fx_result,
            0), _fx_catch_1);

   _fx_catch_1: ;
   }

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM17check_n_walk_kexpN14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t v_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(callb_0->kcb_kexp, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(e_0, callb_0, fx_result, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      FX_CALL(_fx_M6K_formFM9walk_kexpN14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(e_0, callb_0, fx_result, 0), _fx_catch_1);

   _fx_catch_1: ;
   }

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__kexp_t2N14K_form__kexp_tR17K_form__k_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM16check_n_walk_domN13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N13K_form__dom_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = d_0->tag;
   if (tag_0 == 1) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
      _fx_N14K_form__atom_t v_1 = {0};
      _fx_N14K_form__atom_t* a_0 = &d_0->u.DomainElem;
      FX_COPY_PTR(callb_0->kcb_atom, &v_0);
      if ((v_0 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
         FX_CALL(f_0->fp(a_0, loc_0, callb_0, &v_1, f_0->fcv), _fx_catch_0);

      _fx_catch_0: ;
      }
      else {
         if (a_0->tag == 2) {
            _fx_N14K_form__klit_t* v_2 = &a_0->u.AtomLit;
            if (v_2->tag == 8) {
               _fx_N14K_form__ktyp_t v_3 = 0;
               _fx_N14K_form__klit_t v_4 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_2->u.KLitNil,
                     loc_0, callb_0, &v_3, 0), _fx_catch_1);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_3, &v_4);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_4, &v_1);

            _fx_catch_1: ;
               _fx_free_N14K_form__klit_t(&v_4);
               if (v_3) {
                  _fx_free_N14K_form__ktyp_t(&v_3);
               }
               goto _fx_endmatch_0;
            }
         }
         _fx_copy_N14K_form__atom_t(a_0, &v_1);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_2);

      _fx_catch_2: ;
      }
      FX_CHECK_EXN(_fx_catch_3);
      _fx_M6K_formFM10DomainElemN13K_form__dom_t1N14K_form__atom_t(&v_1, fx_result);

   _fx_catch_3: ;
      _fx_free_N14K_form__atom_t(&v_1);
      if (v_0) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
      }
   }
   else if (tag_0 == 2) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_5 = 0;
      _fx_N14K_form__atom_t v_6 = {0};
      _fx_N14K_form__atom_t* a_1 = &d_0->u.DomainFast;
      FX_COPY_PTR(callb_0->kcb_atom, &v_5);
      if ((v_5 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_1 = &v_5->u.Some;
         FX_CALL(f_1->fp(a_1, loc_0, callb_0, &v_6, f_1->fcv), _fx_catch_4);

      _fx_catch_4: ;
      }
      else {
         if (a_1->tag == 2) {
            _fx_N14K_form__klit_t* v_7 = &a_1->u.AtomLit;
            if (v_7->tag == 8) {
               _fx_N14K_form__ktyp_t v_8 = 0;
               _fx_N14K_form__klit_t v_9 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_7->u.KLitNil,
                     loc_0, callb_0, &v_8, 0), _fx_catch_5);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_8, &v_9);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_9, &v_6);

            _fx_catch_5: ;
               _fx_free_N14K_form__klit_t(&v_9);
               if (v_8) {
                  _fx_free_N14K_form__ktyp_t(&v_8);
               }
               goto _fx_endmatch_1;
            }
         }
         _fx_copy_N14K_form__atom_t(a_1, &v_6);

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_6);

      _fx_catch_6: ;
      }
      FX_CHECK_EXN(_fx_catch_7);
      _fx_M6K_formFM10DomainFastN13K_form__dom_t1N14K_form__atom_t(&v_6, fx_result);

   _fx_catch_7: ;
      _fx_free_N14K_form__atom_t(&v_6);
      if (v_5) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_5);
      }
   }
   else if (tag_0 == 3) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_10 = 0;
      _fx_N14K_form__atom_t v_11 = {0};
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_12 = 0;
      _fx_N14K_form__atom_t v_13 = {0};
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_14 = 0;
      _fx_N14K_form__atom_t v_15 = {0};
      _fx_Ta3N14K_form__atom_t* vcase_0 = &d_0->u.DomainRange;
      _fx_N14K_form__atom_t* c_0 = &vcase_0->t2;
      _fx_N14K_form__atom_t* b_0 = &vcase_0->t1;
      _fx_N14K_form__atom_t* a_2 = &vcase_0->t0;
      FX_COPY_PTR(callb_0->kcb_atom, &v_10);
      if ((v_10 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_2 = &v_10->u.Some;
         FX_CALL(f_2->fp(a_2, loc_0, callb_0, &v_11, f_2->fcv), _fx_catch_8);

      _fx_catch_8: ;
      }
      else {
         if (a_2->tag == 2) {
            _fx_N14K_form__klit_t* v_16 = &a_2->u.AtomLit;
            if (v_16->tag == 8) {
               _fx_N14K_form__ktyp_t v_17 = 0;
               _fx_N14K_form__klit_t v_18 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_16->u.KLitNil,
                     loc_0, callb_0, &v_17, 0), _fx_catch_9);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_17, &v_18);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_18, &v_11);

            _fx_catch_9: ;
               _fx_free_N14K_form__klit_t(&v_18);
               if (v_17) {
                  _fx_free_N14K_form__ktyp_t(&v_17);
               }
               goto _fx_endmatch_2;
            }
         }
         _fx_copy_N14K_form__atom_t(a_2, &v_11);

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_10);

      _fx_catch_10: ;
      }
      FX_CHECK_EXN(_fx_catch_17);
      FX_COPY_PTR(callb_0->kcb_atom, &v_12);
      if ((v_12 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_3 = &v_12->u.Some;
         FX_CALL(f_3->fp(b_0, loc_0, callb_0, &v_13, f_3->fcv), _fx_catch_11);

      _fx_catch_11: ;
      }
      else {
         if (b_0->tag == 2) {
            _fx_N14K_form__klit_t* v_19 = &b_0->u.AtomLit;
            if (v_19->tag == 8) {
               _fx_N14K_form__ktyp_t v_20 = 0;
               _fx_N14K_form__klit_t v_21 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_19->u.KLitNil,
                     loc_0, callb_0, &v_20, 0), _fx_catch_12);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_20, &v_21);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_21, &v_13);

            _fx_catch_12: ;
               _fx_free_N14K_form__klit_t(&v_21);
               if (v_20) {
                  _fx_free_N14K_form__ktyp_t(&v_20);
               }
               goto _fx_endmatch_3;
            }
         }
         _fx_copy_N14K_form__atom_t(b_0, &v_13);

      _fx_endmatch_3: ;
         FX_CHECK_EXN(_fx_catch_13);

      _fx_catch_13: ;
      }
      FX_CHECK_EXN(_fx_catch_17);
      FX_COPY_PTR(callb_0->kcb_atom, &v_14);
      if ((v_14 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_4 = &v_14->u.Some;
         FX_CALL(f_4->fp(c_0, loc_0, callb_0, &v_15, f_4->fcv), _fx_catch_14);

      _fx_catch_14: ;
      }
      else {
         if (c_0->tag == 2) {
            _fx_N14K_form__klit_t* v_22 = &c_0->u.AtomLit;
            if (v_22->tag == 8) {
               _fx_N14K_form__ktyp_t v_23 = 0;
               _fx_N14K_form__klit_t v_24 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_22->u.KLitNil,
                     loc_0, callb_0, &v_23, 0), _fx_catch_15);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_23, &v_24);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_24, &v_15);

            _fx_catch_15: ;
               _fx_free_N14K_form__klit_t(&v_24);
               if (v_23) {
                  _fx_free_N14K_form__ktyp_t(&v_23);
               }
               goto _fx_endmatch_4;
            }
         }
         _fx_copy_N14K_form__atom_t(c_0, &v_15);

      _fx_endmatch_4: ;
         FX_CHECK_EXN(_fx_catch_16);

      _fx_catch_16: ;
      }
      FX_CHECK_EXN(_fx_catch_17);
      _fx_M6K_formFM11DomainRangeN13K_form__dom_t3N14K_form__atom_tN14K_form__atom_tN14K_form__atom_t(&v_11, &v_13, &v_15,
         fx_result);

   _fx_catch_17: ;
      _fx_free_N14K_form__atom_t(&v_15);
      if (v_14) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_14);
      }
      _fx_free_N14K_form__atom_t(&v_13);
      if (v_12) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_12);
      }
      _fx_free_N14K_form__atom_t(&v_11);
      if (v_10) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_10);
      }
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM15check_n_walk_idR9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_N14K_form__atom_t v_1 = {0};
      _fx_N14K_form__atom_t v_2 = {0};
      _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_1);
      FX_CALL(f_0->fp(&v_1, loc_0, callb_0, &v_2, f_0->fcv), _fx_catch_1);
      if (v_2.tag == 1) {
         *fx_result = v_2.u.AtomId;
      }
      else {
         fx_exn_t v_3 = {0};
         fx_str_t slit_0 =
            FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_3, 0), _fx_catch_0);
         FX_THROW(&v_3, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_3);
      }
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
      _fx_free_N14K_form__atom_t(&v_2);
      _fx_free_N14K_form__atom_t(&v_1);
   }
   else {
      *fx_result = *n_0;
   }
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(t_0);
   bool res_0;
   if (tag_0 == 1) {
      res_0 = true;
   }
   else if (tag_0 == 6) {
      res_0 = true;
   }
   else if (tag_0 == 2) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else if (tag_0 == 5) {
      res_0 = true;
   }
   else if (tag_0 == 7) {
      res_0 = true;
   }
   else if (tag_0 == 8) {
      res_0 = true;
   }
   else if (tag_0 == 9) {
      res_0 = true;
   }
   else if (tag_0 == 10) {
      res_0 = true;
   }
   else if (tag_0 == 11) {
      res_0 = true;
   }
   else if (tag_0 == 21) {
      res_0 = true;
   }
   else if (tag_0 == 22) {
      res_0 = true;
   }
   else if (tag_0 == 23) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      FX_COPY_PTR(t_0, fx_result); goto _fx_endmatch_0;
   }
   if (tag_0 == 12) {
      _fx_N14K_form__ktyp_t v_0 = 0;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(t_0->u.KTypRawPointer, callb_0,
            loc_0, &v_0, 0), _fx_catch_0);
      FX_CALL(_fx_M6K_formFM14KTypRawPointerN14K_form__ktyp_t1N14K_form__ktyp_t(v_0, fx_result), _fx_catch_0);

   _fx_catch_0: ;
      if (v_0) {
         _fx_free_N14K_form__ktyp_t(&v_0);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 13) {
      _fx_LN14K_form__ktyp_t v_1 = 0;
      _fx_LN14K_form__ktyp_t args_0 = 0;
      _fx_N14K_form__ktyp_t v_2 = 0;
      _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* vcase_0 = &t_0->u.KTypFun;
      _fx_LN14K_form__ktyp_t lstend_0 = 0;
      FX_COPY_PTR(vcase_0->t0, &args_0);
      _fx_LN14K_form__ktyp_t lst_0 = args_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N14K_form__ktyp_t res_1 = 0;
         _fx_N14K_form__ktyp_t x_0 = lst_0->hd;
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(x_0, callb_0, loc_0, &res_1,
               0), _fx_catch_1);
         _fx_LN14K_form__ktyp_t node_0 = 0;
         FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_1, 0, false, &node_0), _fx_catch_1);
         FX_LIST_APPEND(v_1, lstend_0, node_0);

      _fx_catch_1: ;
         if (res_1) {
            _fx_free_N14K_form__ktyp_t(&res_1);
         }
         FX_CHECK_EXN(_fx_catch_2);
      }
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(vcase_0->t1, callb_0, loc_0,
            &v_2, 0), _fx_catch_2);
      FX_CALL(_fx_M6K_formFM7KTypFunN14K_form__ktyp_t2LN14K_form__ktyp_tN14K_form__ktyp_t(v_1, v_2, fx_result), _fx_catch_2);

   _fx_catch_2: ;
      if (v_2) {
         _fx_free_N14K_form__ktyp_t(&v_2);
      }
      if (args_0) {
         _fx_free_LN14K_form__ktyp_t(&args_0);
      }
      if (v_1) {
         _fx_free_LN14K_form__ktyp_t(&v_1);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 14) {
      _fx_LN14K_form__ktyp_t v_3 = 0;
      _fx_LN14K_form__ktyp_t elems_0 = 0;
      _fx_LN14K_form__ktyp_t lstend_1 = 0;
      FX_COPY_PTR(t_0->u.KTypTuple, &elems_0);
      _fx_LN14K_form__ktyp_t lst_1 = elems_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_N14K_form__ktyp_t res_2 = 0;
         _fx_N14K_form__ktyp_t x_1 = lst_1->hd;
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(x_1, callb_0, loc_0, &res_2,
               0), _fx_catch_3);
         _fx_LN14K_form__ktyp_t node_1 = 0;
         FX_CALL(_fx_cons_LN14K_form__ktyp_t(res_2, 0, false, &node_1), _fx_catch_3);
         FX_LIST_APPEND(v_3, lstend_1, node_1);

      _fx_catch_3: ;
         if (res_2) {
            _fx_free_N14K_form__ktyp_t(&res_2);
         }
         FX_CHECK_EXN(_fx_catch_4);
      }
      FX_CALL(_fx_M6K_formFM9KTypTupleN14K_form__ktyp_t1LN14K_form__ktyp_t(v_3, fx_result), _fx_catch_4);

   _fx_catch_4: ;
      if (elems_0) {
         _fx_free_LN14K_form__ktyp_t(&elems_0);
      }
      if (v_3) {
         _fx_free_LN14K_form__ktyp_t(&v_3);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 15) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_4 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_5 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_0 = 0;
      _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* vcase_1 = &t_0->u.KTypRecord;
      _fx_R9Ast__id_t* rn_0 = &vcase_1->t0;
      FX_COPY_PTR(callb_0->kcb_atom, &v_4);
      _fx_R9Ast__id_t v_6;
      if ((v_4 != 0) + 1 == 2) {
         _fx_N14K_form__atom_t v_7 = {0};
         _fx_N14K_form__atom_t v_8 = {0};
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_4->u.Some;
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(rn_0, &v_7);
         FX_CALL(f_0->fp(&v_7, loc_0, callb_0, &v_8, f_0->fcv), _fx_catch_6);
         if (v_8.tag == 1) {
            v_6 = v_8.u.AtomId;
         }
         else {
            fx_exn_t v_9 = {0};
            fx_str_t slit_0 =
               FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_9, 0), _fx_catch_5);
            FX_THROW(&v_9, false, _fx_catch_5);

         _fx_catch_5: ;
            fx_free_exn(&v_9);
         }
         FX_CHECK_EXN(_fx_catch_6);

      _fx_catch_6: ;
         _fx_free_N14K_form__atom_t(&v_8);
         _fx_free_N14K_form__atom_t(&v_7);
      }
      else {
         v_6 = *rn_0;
      }
      FX_CHECK_EXN(_fx_catch_10);
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_2 = 0;
      FX_COPY_PTR(vcase_1->t1, &relems_0);
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_2 = relems_0;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_N14K_form__ktyp_t ti_0 = 0;
         _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_10 = 0;
         _fx_N14K_form__ktyp_t v_11 = 0;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_0 = {0};
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_2->hd;
         _fx_R9Ast__id_t ni_0 = __pat___0->t0;
         FX_COPY_PTR(__pat___0->t1, &ti_0);
         FX_COPY_PTR(callb_0->kcb_atom, &v_10);
         _fx_R9Ast__id_t v_12;
         if ((v_10 != 0) + 1 == 2) {
            _fx_N14K_form__atom_t v_13 = {0};
            _fx_N14K_form__atom_t v_14 = {0};
            _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_1 = &v_10->u.Some;
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&ni_0, &v_13);
            FX_CALL(f_1->fp(&v_13, loc_0, callb_0, &v_14, f_1->fcv), _fx_catch_8);
            if (v_14.tag == 1) {
               v_12 = v_14.u.AtomId;
            }
            else {
               fx_exn_t v_15 = {0};
               fx_str_t slit_1 =
                  FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_15, 0), _fx_catch_7);
               FX_THROW(&v_15, false, _fx_catch_7);

            _fx_catch_7: ;
               fx_free_exn(&v_15);
            }
            FX_CHECK_EXN(_fx_catch_8);

         _fx_catch_8: ;
            _fx_free_N14K_form__atom_t(&v_14);
            _fx_free_N14K_form__atom_t(&v_13);
         }
         else {
            v_12 = ni_0;
         }
         FX_CHECK_EXN(_fx_catch_9);
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(ti_0, callb_0, loc_0, &v_11,
               0), _fx_catch_9);
         _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&v_12, v_11, &tup_0);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_2 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_0, 0, false, &node_2), _fx_catch_9);
         FX_LIST_APPEND(v_5, lstend_2, node_2);

      _fx_catch_9: ;
         _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_0);
         if (v_11) {
            _fx_free_N14K_form__ktyp_t(&v_11);
         }
         if (v_10) {
            _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_10);
         }
         if (ti_0) {
            _fx_free_N14K_form__ktyp_t(&ti_0);
         }
         FX_CHECK_EXN(_fx_catch_10);
      }
      FX_CALL(_fx_M6K_formFM10KTypRecordN14K_form__ktyp_t2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t(&v_6, v_5, fx_result),
         _fx_catch_10);

   _fx_catch_10: ;
      if (relems_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_0);
      }
      if (v_5) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_5);
      }
      if (v_4) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_4);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 16) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_16 = 0;
      _fx_R9Ast__id_t* k_0 = &t_0->u.KTypName;
      FX_COPY_PTR(callb_0->kcb_atom, &v_16);
      _fx_R9Ast__id_t v_17;
      if ((v_16 != 0) + 1 == 2) {
         _fx_N14K_form__atom_t v_18 = {0};
         _fx_N14K_form__atom_t v_19 = {0};
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_2 = &v_16->u.Some;
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(k_0, &v_18);
         FX_CALL(f_2->fp(&v_18, loc_0, callb_0, &v_19, f_2->fcv), _fx_catch_12);
         if (v_19.tag == 1) {
            v_17 = v_19.u.AtomId;
         }
         else {
            fx_exn_t v_20 = {0};
            fx_str_t slit_2 =
               FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_20, 0), _fx_catch_11);
            FX_THROW(&v_20, false, _fx_catch_11);

         _fx_catch_11: ;
            fx_free_exn(&v_20);
         }
         FX_CHECK_EXN(_fx_catch_12);

      _fx_catch_12: ;
         _fx_free_N14K_form__atom_t(&v_19);
         _fx_free_N14K_form__atom_t(&v_18);
      }
      else {
         v_17 = *k_0;
      }
      FX_CHECK_EXN(_fx_catch_13);
      FX_CALL(_fx_M6K_formFM8KTypNameN14K_form__ktyp_t1R9Ast__id_t(&v_17, fx_result), _fx_catch_13);

   _fx_catch_13: ;
      if (v_16) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_16);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 17) {
      _fx_N14K_form__ktyp_t v_21 = 0;
      _fx_T2iN14K_form__ktyp_t* vcase_2 = &t_0->u.KTypArray;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(vcase_2->t1, callb_0, loc_0,
            &v_21, 0), _fx_catch_14);
      FX_CALL(_fx_M6K_formFM9KTypArrayN14K_form__ktyp_t2iN14K_form__ktyp_t(vcase_2->t0, v_21, fx_result), _fx_catch_14);

   _fx_catch_14: ;
      if (v_21) {
         _fx_free_N14K_form__ktyp_t(&v_21);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 18) {
      _fx_N14K_form__ktyp_t v_22 = 0;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(t_0->u.KTypVector, callb_0,
            loc_0, &v_22, 0), _fx_catch_15);
      FX_CALL(_fx_M6K_formFM10KTypVectorN14K_form__ktyp_t1N14K_form__ktyp_t(v_22, fx_result), _fx_catch_15);

   _fx_catch_15: ;
      if (v_22) {
         _fx_free_N14K_form__ktyp_t(&v_22);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 19) {
      _fx_N14K_form__ktyp_t v_23 = 0;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(t_0->u.KTypList, callb_0, loc_0,
            &v_23, 0), _fx_catch_16);
      FX_CALL(_fx_M6K_formFM8KTypListN14K_form__ktyp_t1N14K_form__ktyp_t(v_23, fx_result), _fx_catch_16);

   _fx_catch_16: ;
      if (v_23) {
         _fx_free_N14K_form__ktyp_t(&v_23);
      }
      goto _fx_endmatch_0;
   }
   if (tag_0 == 20) {
      _fx_N14K_form__ktyp_t v_24 = 0;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(t_0->u.KTypRef, callb_0, loc_0,
            &v_24, 0), _fx_catch_17);
      FX_CALL(_fx_M6K_formFM7KTypRefN14K_form__ktyp_t1N14K_form__ktyp_t(v_24, fx_result), _fx_catch_17);

   _fx_catch_17: ;
      if (v_24) {
         _fx_free_N14K_form__ktyp_t(&v_24);
      }
      goto _fx_endmatch_0;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tRM9k_callb_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(
      _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_0, loc_0, callb_0,
         fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9walk_kexpN14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(e_0);
   if (tag_0 == 1) {
      FX_COPY_PTR(e_0, fx_result);
   }
   else if (tag_0 == 2) {
      FX_COPY_PTR(e_0, fx_result);
   }
   else if (tag_0 == 3) {
      FX_COPY_PTR(e_0, fx_result);
   }
   else if (tag_0 == 4) {
      _fx_Nt6option1N14K_form__atom_t v_0 = {0};
      _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* vcase_0 = &e_0->u.KExpReturn;
      _fx_R10Ast__loc_t* loc_0 = &vcase_0->t1;
      _fx_Nt6option1N14K_form__atom_t* a_opt_0 = &vcase_0->t0;
      if (a_opt_0->tag == 2) {
         _fx_N14K_form__atom_t v_1 = {0};
         FX_CALL(
            _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&a_opt_0->u.Some, loc_0,
               callb_0, &v_1, 0), _fx_catch_0);
         _fx_M6K_formFM4SomeNt6option1N14K_form__atom_t1N14K_form__atom_t(&v_1, &v_0);

      _fx_catch_0: ;
         _fx_free_N14K_form__atom_t(&v_1);
      }
      else {
         _fx_copy_Nt6option1N14K_form__atom_t(&_fx_g14K_form__None2_, &v_0);
      }
      FX_CHECK_EXN(_fx_catch_1);
      FX_CALL(_fx_M6K_formFM10KExpReturnN14K_form__kexp_t2Nt6option1N14K_form__atom_tR10Ast__loc_t(&v_0, loc_0, fx_result),
         _fx_catch_1);

   _fx_catch_1: ;
      _fx_free_Nt6option1N14K_form__atom_t(&v_0);
   }
   else if (tag_0 == 5) {
      _fx_N14K_form__atom_t v_2 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_3 = {0};
      _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_1 = &e_0->u.KExpAtom;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_0 = &vcase_1->t1;
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_1->t0, &ctx_0->t1,
            callb_0, &v_2, 0), _fx_catch_2);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_0, callb_0,
            &v_3, 0), _fx_catch_2);
      FX_CALL(_fx_M6K_formFM8KExpAtomN14K_form__kexp_t2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_2, &v_3, fx_result),
         _fx_catch_2);

   _fx_catch_2: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_3);
      _fx_free_N14K_form__atom_t(&v_2);
   }
   else if (tag_0 == 6) {
      _fx_N14K_form__atom_t v_4 = {0};
      _fx_N14K_form__atom_t v_5 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_6 = {0};
      _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_2 = &e_0->u.KExpBinary;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_1 = &vcase_2->t3;
      _fx_R10Ast__loc_t* loc_1 = &ctx_1->t1;
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_2->t1, loc_1, callb_0,
            &v_4, 0), _fx_catch_3);
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_2->t2, loc_1, callb_0,
            &v_5, 0), _fx_catch_3);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_1, callb_0,
            &v_6, 0), _fx_catch_3);
      FX_CALL(
         _fx_M6K_formFM10KExpBinaryN14K_form__kexp_t4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            vcase_2->t0, &v_4, &v_5, &v_6, fx_result), _fx_catch_3);

   _fx_catch_3: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_6);
      _fx_free_N14K_form__atom_t(&v_5);
      _fx_free_N14K_form__atom_t(&v_4);
   }
   else if (tag_0 == 7) {
      _fx_N14K_form__atom_t v_7 = {0};
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_8 = {0};
      _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_3 = &e_0->u.KExpUnary;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_2 = &vcase_3->t2;
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_3->t1, &ctx_2->t1,
            callb_0, &v_7, 0), _fx_catch_4);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_2, callb_0,
            &v_8, 0), _fx_catch_4);
      FX_CALL(
         _fx_M6K_formFM9KExpUnaryN14K_form__kexp_t3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &vcase_3->t0, &v_7, &v_8, fx_result), _fx_catch_4);

   _fx_catch_4: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_8);
      _fx_free_N14K_form__atom_t(&v_7);
   }
   else if (tag_0 == 8) {
      _fx_LN14K_form__atom_t v_9 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_10 = {0};
      _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_4 = &e_0->u.KExpIntrin;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_3 = &vcase_4->t2;
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_4->t1, &ctx_3->t1, callb_0,
            &v_9, 0), _fx_catch_5);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_3, callb_0,
            &v_10, 0), _fx_catch_5);
      FX_CALL(
         _fx_M6K_formFM10KExpIntrinN14K_form__kexp_t3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &vcase_4->t0, v_9, &v_10, fx_result), _fx_catch_5);

   _fx_catch_5: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_10);
      if (v_9) {
         _fx_free_LN14K_form__atom_t(&v_9);
      }
   }
   else if (tag_0 == 11) {
      _fx_N14K_form__kexp_t v_11 = 0;
      _fx_N14K_form__kexp_t v_12 = 0;
      _fx_N14K_form__kexp_t v_13 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_14 = {0};
      _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_5 = &e_0->u.KExpIf;
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_5->t0, callb_0, &v_11, 0),
         _fx_catch_6);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_5->t1, callb_0, &v_12, 0),
         _fx_catch_6);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_5->t2, callb_0, &v_13, 0),
         _fx_catch_6);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(&vcase_5->t3,
            callb_0, &v_14, 0), _fx_catch_6);
      FX_CALL(
         _fx_M6K_formFM6KExpIfN14K_form__kexp_t4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(
            v_11, v_12, v_13, &v_14, fx_result), _fx_catch_6);

   _fx_catch_6: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_14);
      if (v_13) {
         _fx_free_N14K_form__kexp_t(&v_13);
      }
      if (v_12) {
         _fx_free_N14K_form__kexp_t(&v_12);
      }
      if (v_11) {
         _fx_free_N14K_form__kexp_t(&v_11);
      }
   }
   else if (tag_0 == 10) {
      _fx_LN14K_form__kexp_t new_elist_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_15 = {0};
      _fx_N14K_form__ktyp_t new_ktyp_0 = 0;
      _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_6 = &e_0->u.KExpSeq;
      FX_CALL(
         _fx_M6K_formFM13process_elistLN14K_form__kexp_t3LN14K_form__kexp_tLN14K_form__kexp_tRM9k_callb_t(vcase_6->t0, 0,
            callb_0, &new_elist_0, 0), _fx_catch_9);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(&vcase_6->t1,
            callb_0, &v_15, 0), _fx_catch_9);
      FX_COPY_PTR(v_15.t0, &new_ktyp_0);
      _fx_R10Ast__loc_t loc_2 = v_15.t1;
      if (new_elist_0 == 0) {
         FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(&loc_2, fx_result), _fx_catch_7);

      _fx_catch_7: ;
         goto _fx_endmatch_0;
      }
      if (new_elist_0 != 0) {
         if (new_elist_0->tl == 0) {
            FX_COPY_PTR(new_elist_0->hd, fx_result); goto _fx_endmatch_0;
         }
      }
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_16 = {0};
      _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(new_ktyp_0, &loc_2, &v_16);
      FX_CALL(
         _fx_M6K_formFM7KExpSeqN14K_form__kexp_t2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(new_elist_0, &v_16,
            fx_result), _fx_catch_8);

   _fx_catch_8: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_16);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      if (new_ktyp_0) {
         _fx_free_N14K_form__ktyp_t(&new_ktyp_0);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_15);
      if (new_elist_0) {
         _fx_free_LN14K_form__kexp_t(&new_elist_0);
      }
   }
   else if (tag_0 == 9) {
      _fx_N14K_form__kexp_t v_17 = 0;
      _fx_T2R9Ast__id_tN14K_form__kexp_t* vcase_7 = &e_0->u.KExpSync;
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_7->t1, callb_0, &v_17, 0),
         _fx_catch_10);
      FX_CALL(_fx_M6K_formFM8KExpSyncN14K_form__kexp_t2R9Ast__id_tN14K_form__kexp_t(&vcase_7->t0, v_17, fx_result),
         _fx_catch_10);

   _fx_catch_10: ;
      if (v_17) {
         _fx_free_N14K_form__kexp_t(&v_17);
      }
   }
   else if (tag_0 == 14) {
      _fx_LN14K_form__atom_t v_18 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_19 = {0};
      _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_8 = &e_0->u.KExpMkTuple;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_4 = &vcase_8->t1;
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_8->t0, &ctx_4->t1, callb_0,
            &v_18, 0), _fx_catch_11);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_4, callb_0,
            &v_19, 0), _fx_catch_11);
      FX_CALL(
         _fx_M6K_formFM11KExpMkTupleN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_18, &v_19,
            fx_result), _fx_catch_11);

   _fx_catch_11: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_19);
      if (v_18) {
         _fx_free_LN14K_form__atom_t(&v_18);
      }
   }
   else if (tag_0 == 15) {
      _fx_LN14K_form__atom_t v_20 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_21 = {0};
      _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_9 = &e_0->u.KExpMkRecord;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_5 = &vcase_9->t1;
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_9->t0, &ctx_5->t1, callb_0,
            &v_20, 0), _fx_catch_12);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_5, callb_0,
            &v_21, 0), _fx_catch_12);
      FX_CALL(
         _fx_M6K_formFM12KExpMkRecordN14K_form__kexp_t2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_20, &v_21,
            fx_result), _fx_catch_12);

   _fx_catch_12: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_21);
      if (v_20) {
         _fx_free_LN14K_form__atom_t(&v_20);
      }
   }
   else if (tag_0 == 16) {
      _fx_LN14K_form__atom_t v_22 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_23 = {0};
      _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_10 = &e_0->u.KExpMkClosure;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_6 = &vcase_10->t3;
      _fx_R10Ast__loc_t* loc_3 = &ctx_6->t1;
      _fx_R9Ast__id_t v_24;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_10->t0, loc_3, callb_0, &v_24, 0),
         _fx_catch_13);
      _fx_R9Ast__id_t v_25;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_10->t1, loc_3, callb_0, &v_25, 0),
         _fx_catch_13);
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_10->t2, loc_3, callb_0,
            &v_22, 0), _fx_catch_13);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_6, callb_0,
            &v_23, 0), _fx_catch_13);
      FX_CALL(
         _fx_M6K_formFM13KExpMkClosureN14K_form__kexp_t4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &v_24, &v_25, v_22, &v_23, fx_result), _fx_catch_13);

   _fx_catch_13: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_23);
      if (v_22) {
         _fx_free_LN14K_form__atom_t(&v_22);
      }
   }
   else if (tag_0 == 17) {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_26 = {0};
      _fx_LLT2BN14K_form__atom_t v_27 = 0;
      _fx_LLT2BN14K_form__atom_t elems_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_28 = {0};
      _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_11 = &e_0->u.KExpMkArray;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_7 = &vcase_11->t2;
      _fx_LLT2BN14K_form__atom_t elems_1 = vcase_11->t1;
      bool all_literals_0 = vcase_11->t0;
      if (all_literals_0) {
         FX_CALL(
            _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_7,
               callb_0, &v_26, 0), _fx_catch_16);
         FX_CALL(
            _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(all_literals_0,
               elems_1, &v_26, fx_result), _fx_catch_16);
      }
      else {
         _fx_LLT2BN14K_form__atom_t lstend_0 = 0;
         FX_COPY_PTR(elems_1, &elems_0);
         _fx_LLT2BN14K_form__atom_t lst_0 = elems_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_LT2BN14K_form__atom_t __fold_result___0 = 0;
            _fx_LT2BN14K_form__atom_t new_row_0 = 0;
            _fx_LT2BN14K_form__atom_t res_0 = 0;
            _fx_LT2BN14K_form__atom_t row_0 = lst_0->hd;
            _fx_LT2BN14K_form__atom_t lst_1 = row_0;
            for (; lst_1; lst_1 = lst_1->tl) {
               _fx_N14K_form__atom_t a_0 = {0};
               _fx_LT2BN14K_form__atom_t new_row_1 = 0;
               _fx_N14K_form__atom_t v_29 = {0};
               _fx_T2BN14K_form__atom_t v_30 = {0};
               _fx_T2BN14K_form__atom_t* __pat___0 = &lst_1->hd;
               _fx_copy_N14K_form__atom_t(&__pat___0->t1, &a_0);
               FX_COPY_PTR(__fold_result___0, &new_row_1);
               FX_CALL(
                  _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&a_0, &ctx_7->t1,
                     callb_0, &v_29, 0), _fx_catch_14);
               _fx_make_T2BN14K_form__atom_t(__pat___0->t0, &v_29, &v_30);
               FX_CALL(_fx_cons_LT2BN14K_form__atom_t(&v_30, new_row_1, false, &new_row_1), _fx_catch_14);
               _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
               FX_COPY_PTR(new_row_1, &__fold_result___0);

            _fx_catch_14: ;
               _fx_free_T2BN14K_form__atom_t(&v_30);
               _fx_free_N14K_form__atom_t(&v_29);
               if (new_row_1) {
                  _fx_free_LT2BN14K_form__atom_t(&new_row_1);
               }
               _fx_free_N14K_form__atom_t(&a_0);
               FX_CHECK_EXN(_fx_catch_15);
            }
            FX_COPY_PTR(__fold_result___0, &new_row_0);
            FX_CALL(_fx_M6K_formFM3revLT2BN14K_form__atom_t1LT2BN14K_form__atom_t(new_row_0, &res_0, 0), _fx_catch_15);
            _fx_LLT2BN14K_form__atom_t node_0 = 0;
            FX_CALL(_fx_cons_LLT2BN14K_form__atom_t(res_0, 0, false, &node_0), _fx_catch_15);
            FX_LIST_APPEND(v_27, lstend_0, node_0);

         _fx_catch_15: ;
            if (res_0) {
               _fx_free_LT2BN14K_form__atom_t(&res_0);
            }
            if (new_row_0) {
               _fx_free_LT2BN14K_form__atom_t(&new_row_0);
            }
            if (__fold_result___0) {
               _fx_free_LT2BN14K_form__atom_t(&__fold_result___0);
            }
            FX_CHECK_EXN(_fx_catch_16);
         }
         FX_CALL(
            _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_7,
               callb_0, &v_28, 0), _fx_catch_16);
         FX_CALL(
            _fx_M6K_formFM11KExpMkArrayN14K_form__kexp_t3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(false, v_27,
               &v_28, fx_result), _fx_catch_16);
      }

   _fx_catch_16: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_28);
      if (elems_0) {
         _fx_free_LLT2BN14K_form__atom_t(&elems_0);
      }
      if (v_27) {
         _fx_free_LLT2BN14K_form__atom_t(&v_27);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_26);
   }
   else if (tag_0 == 18) {
      _fx_LT2BN14K_form__atom_t v_31 = 0;
      _fx_LT2BN14K_form__atom_t elems_2 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_32 = {0};
      _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_12 = &e_0->u.KExpMkVector;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_8 = &vcase_12->t1;
      _fx_LT2BN14K_form__atom_t lstend_1 = 0;
      FX_COPY_PTR(vcase_12->t0, &elems_2);
      _fx_LT2BN14K_form__atom_t lst_2 = elems_2;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_N14K_form__atom_t a_1 = {0};
         _fx_N14K_form__atom_t v_33 = {0};
         _fx_T2BN14K_form__atom_t tup_0 = {0};
         _fx_T2BN14K_form__atom_t* __pat___1 = &lst_2->hd;
         _fx_copy_N14K_form__atom_t(&__pat___1->t1, &a_1);
         FX_CALL(
            _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&a_1, &ctx_8->t1, callb_0,
               &v_33, 0), _fx_catch_17);
         _fx_make_T2BN14K_form__atom_t(__pat___1->t0, &v_33, &tup_0);
         _fx_LT2BN14K_form__atom_t node_1 = 0;
         FX_CALL(_fx_cons_LT2BN14K_form__atom_t(&tup_0, 0, false, &node_1), _fx_catch_17);
         FX_LIST_APPEND(v_31, lstend_1, node_1);

      _fx_catch_17: ;
         _fx_free_T2BN14K_form__atom_t(&tup_0);
         _fx_free_N14K_form__atom_t(&v_33);
         _fx_free_N14K_form__atom_t(&a_1);
         FX_CHECK_EXN(_fx_catch_18);
      }
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_8, callb_0,
            &v_32, 0), _fx_catch_18);
      FX_CALL(
         _fx_M6K_formFM12KExpMkVectorN14K_form__kexp_t2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(v_31, &v_32,
            fx_result), _fx_catch_18);

   _fx_catch_18: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_32);
      if (elems_2) {
         _fx_free_LT2BN14K_form__atom_t(&elems_2);
      }
      if (v_31) {
         _fx_free_LT2BN14K_form__atom_t(&v_31);
      }
   }
   else if (tag_0 == 12) {
      _fx_LN14K_form__atom_t v_34 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_35 = {0};
      _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_13 = &e_0->u.KExpCall;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_9 = &vcase_13->t2;
      _fx_R10Ast__loc_t* loc_4 = &ctx_9->t1;
      _fx_R9Ast__id_t v_36;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_13->t0, loc_4, callb_0, &v_36, 0),
         _fx_catch_19);
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_13->t1, loc_4, callb_0,
            &v_34, 0), _fx_catch_19);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_9, callb_0,
            &v_35, 0), _fx_catch_19);
      FX_CALL(
         _fx_M6K_formFM8KExpCallN14K_form__kexp_t3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_36, v_34,
            &v_35, fx_result), _fx_catch_19);

   _fx_catch_19: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_35);
      if (v_34) {
         _fx_free_LN14K_form__atom_t(&v_34);
      }
   }
   else if (tag_0 == 13) {
      _fx_LN14K_form__atom_t v_37 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_38 = {0};
      _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_14 = &e_0->u.KExpICall;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_10 = &vcase_14->t3;
      _fx_R10Ast__loc_t* loc_5 = &ctx_10->t1;
      _fx_R9Ast__id_t v_39;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_14->t0, loc_5, callb_0, &v_39, 0),
         _fx_catch_20);
      FX_CALL(
         _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(vcase_14->t2, loc_5, callb_0,
            &v_37, 0), _fx_catch_20);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_10,
            callb_0, &v_38, 0), _fx_catch_20);
      FX_CALL(
         _fx_M6K_formFM9KExpICallN14K_form__kexp_t4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t(&v_39,
            vcase_14->t1, v_37, &v_38, fx_result), _fx_catch_20);

   _fx_catch_20: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_38);
      if (v_37) {
         _fx_free_LN14K_form__atom_t(&v_37);
      }
   }
   else if (tag_0 == 19) {
      _fx_N14K_form__atom_t v_40 = {0};
      _fx_LN13K_form__dom_t v_41 = 0;
      _fx_LN13K_form__dom_t idxs_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_42 = {0};
      _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_15 =
         &e_0->u.KExpAt;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_11 = &vcase_15->t4;
      _fx_R10Ast__loc_t* loc_6 = &ctx_11->t1;
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_15->t0, loc_6, callb_0,
            &v_40, 0), _fx_catch_22);
      _fx_LN13K_form__dom_t lstend_2 = 0;
      FX_COPY_PTR(vcase_15->t3, &idxs_0);
      _fx_LN13K_form__dom_t lst_3 = idxs_0;
      for (; lst_3; lst_3 = lst_3->tl) {
         _fx_N13K_form__dom_t res_1 = {0};
         _fx_N13K_form__dom_t* idx_0 = &lst_3->hd;
         FX_CALL(
            _fx_M6K_formFM9walk_dom_N13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(idx_0, loc_6, callb_0, &res_1,
               0), _fx_catch_21);
         _fx_LN13K_form__dom_t node_2 = 0;
         FX_CALL(_fx_cons_LN13K_form__dom_t(&res_1, 0, false, &node_2), _fx_catch_21);
         FX_LIST_APPEND(v_41, lstend_2, node_2);

      _fx_catch_21: ;
         _fx_free_N13K_form__dom_t(&res_1);
         FX_CHECK_EXN(_fx_catch_22);
      }
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_11,
            callb_0, &v_42, 0), _fx_catch_22);
      FX_CALL(
         _fx_M6K_formFM6KExpAtN14K_form__kexp_t5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t(
            &v_40, &vcase_15->t1, &vcase_15->t2, v_41, &v_42, fx_result), _fx_catch_22);

   _fx_catch_22: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_42);
      if (idxs_0) {
         _fx_free_LN13K_form__dom_t(&idxs_0);
      }
      if (v_41) {
         _fx_free_LN13K_form__dom_t(&v_41);
      }
      _fx_free_N14K_form__atom_t(&v_40);
   }
   else if (tag_0 == 21) {
      _fx_N14K_form__atom_t v_43 = {0};
      _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* vcase_16 = &e_0->u.KExpAssign;
      _fx_R10Ast__loc_t* loc_7 = &vcase_16->t2;
      _fx_R9Ast__id_t v_44;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_16->t0, loc_7, callb_0, &v_44, 0),
         _fx_catch_23);
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_16->t1, loc_7, callb_0,
            &v_43, 0), _fx_catch_23);
      FX_CALL(
         _fx_M6K_formFM10KExpAssignN14K_form__kexp_t3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t(&v_44, &v_43, loc_7, fx_result),
         _fx_catch_23);

   _fx_catch_23: ;
      _fx_free_N14K_form__atom_t(&v_43);
   }
   else if (tag_0 == 20) {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_45 = {0};
      _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* vcase_17 = &e_0->u.KExpMem;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_12 = &vcase_17->t2;
      _fx_R9Ast__id_t v_46;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_17->t0, &ctx_12->t1, callb_0, &v_46, 0),
         _fx_catch_24);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_12,
            callb_0, &v_45, 0), _fx_catch_24);
      FX_CALL(
         _fx_M6K_formFM7KExpMemN14K_form__kexp_t3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t(&v_46, vcase_17->t1, &v_45,
            fx_result), _fx_catch_24);

   _fx_catch_24: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_45);
   }
   else if (tag_0 == 24) {
      _fx_T3R9Ast__id_tBR10Ast__loc_t* vcase_18 = &e_0->u.KExpThrow;
      _fx_R10Ast__loc_t* loc_8 = &vcase_18->t2;
      _fx_R9Ast__id_t v_47;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_18->t0, loc_8, callb_0, &v_47, 0),
         _fx_catch_25);
      FX_CALL(_fx_M6K_formFM9KExpThrowN14K_form__kexp_t3R9Ast__id_tBR10Ast__loc_t(&v_47, vcase_18->t1, loc_8, fx_result),
         _fx_catch_25);

   _fx_catch_25: ;
   }
   else if (tag_0 == 28) {
      _fx_N14K_form__kexp_t v_48 = 0;
      _fx_N14K_form__kexp_t v_49 = 0;
      _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* vcase_19 = &e_0->u.KExpWhile;
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_19->t0, callb_0, &v_48, 0),
         _fx_catch_26);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_19->t1, callb_0, &v_49, 0),
         _fx_catch_26);
      FX_CALL(
         _fx_M6K_formFM9KExpWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(v_48, v_49, &vcase_19->t2,
            fx_result), _fx_catch_26);

   _fx_catch_26: ;
      if (v_49) {
         _fx_free_N14K_form__kexp_t(&v_49);
      }
      if (v_48) {
         _fx_free_N14K_form__kexp_t(&v_48);
      }
   }
   else if (tag_0 == 29) {
      _fx_N14K_form__kexp_t v_50 = 0;
      _fx_N14K_form__kexp_t v_51 = 0;
      _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* vcase_20 = &e_0->u.KExpDoWhile;
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_20->t0, callb_0, &v_50, 0),
         _fx_catch_27);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_20->t1, callb_0, &v_51, 0),
         _fx_catch_27);
      FX_CALL(
         _fx_M6K_formFM11KExpDoWhileN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t(v_50, v_51, &vcase_20->t2,
            fx_result), _fx_catch_27);

   _fx_catch_27: ;
      if (v_51) {
         _fx_free_N14K_form__kexp_t(&v_51);
      }
      if (v_50) {
         _fx_free_N14K_form__kexp_t(&v_50);
      }
   }
   else if (tag_0 == 27) {
      _fx_LT2R9Ast__id_tN13K_form__dom_t v_52 = 0;
      _fx_LR9Ast__id_t v_53 = 0;
      _fx_N14K_form__kexp_t v_54 = 0;
      _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* vcase_21 =
         &e_0->u.KExpFor;
      _fx_R10Ast__loc_t* loc_9 = &vcase_21->t4;
      FX_CALL(
         _fx_M6K_formFM14walk_idomlist_LT2R9Ast__id_tN13K_form__dom_t3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
            vcase_21->t0, loc_9, callb_0, &v_52, 0), _fx_catch_28);
      FX_CALL(
         _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(vcase_21->t1, loc_9, true, callb_0,
            &v_53, 0), _fx_catch_28);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_21->t2, callb_0, &v_54, 0),
         _fx_catch_28);
      FX_CALL(
         _fx_M6K_formFM7KExpForN14K_form__kexp_t5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t(
            v_52, v_53, v_54, &vcase_21->t3, loc_9, fx_result), _fx_catch_28);

   _fx_catch_28: ;
      if (v_54) {
         _fx_free_N14K_form__kexp_t(&v_54);
      }
      FX_FREE_LIST_SIMPLE(&v_53);
      if (v_52) {
         _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&v_52);
      }
   }
   else if (tag_0 == 26) {
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t v_55 = 0;
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t e_idoml_l_0 = 0;
      _fx_N14K_form__kexp_t v_56 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_57 = {0};
      _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
         vcase_22 = &e_0->u.KExpMap;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t* ctx_13 = &vcase_22->t3;
      _fx_R10Ast__loc_t* loc_10 = &ctx_13->t1;
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t lstend_3 = 0;
      FX_COPY_PTR(vcase_22->t0, &e_idoml_l_0);
      _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t lst_4 = e_idoml_l_0;
      for (; lst_4; lst_4 = lst_4->tl) {
         _fx_N14K_form__kexp_t e_1 = 0;
         _fx_LT2R9Ast__id_tN13K_form__dom_t idoml_0 = 0;
         _fx_LR9Ast__id_t at_ids_0 = 0;
         _fx_N14K_form__kexp_t v_58 = 0;
         _fx_LT2R9Ast__id_tN13K_form__dom_t v_59 = 0;
         _fx_LR9Ast__id_t v_60 = 0;
         _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t tup_1 = {0};
         _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* __pat___2 = &lst_4->hd;
         FX_COPY_PTR(__pat___2->t0, &e_1);
         FX_COPY_PTR(__pat___2->t1, &idoml_0);
         FX_COPY_PTR(__pat___2->t2, &at_ids_0);
         FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(e_1, callb_0, &v_58, 0),
            _fx_catch_29);
         FX_CALL(
            _fx_M6K_formFM14walk_idomlist_LT2R9Ast__id_tN13K_form__dom_t3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
               idoml_0, loc_10, callb_0, &v_59, 0), _fx_catch_29);
         FX_CALL(
            _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(at_ids_0, loc_10, true, callb_0,
               &v_60, 0), _fx_catch_29);
         _fx_make_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(v_58, v_59, v_60, &tup_1);
         _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t node_3 = 0;
         FX_CALL(_fx_cons_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&tup_1, 0, false, &node_3),
            _fx_catch_29);
         FX_LIST_APPEND(v_55, lstend_3, node_3);

      _fx_catch_29: ;
         _fx_free_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&tup_1);
         FX_FREE_LIST_SIMPLE(&v_60);
         if (v_59) {
            _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&v_59);
         }
         if (v_58) {
            _fx_free_N14K_form__kexp_t(&v_58);
         }
         FX_FREE_LIST_SIMPLE(&at_ids_0);
         if (idoml_0) {
            _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idoml_0);
         }
         if (e_1) {
            _fx_free_N14K_form__kexp_t(&e_1);
         }
         FX_CHECK_EXN(_fx_catch_30);
      }
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_22->t1, callb_0, &v_56, 0),
         _fx_catch_30);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ctx_13,
            callb_0, &v_57, 0), _fx_catch_30);
      FX_CALL(
         _fx_M6K_formFM7KExpMapN14K_form__kexp_t4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t(
            v_55, v_56, &vcase_22->t2, &v_57, fx_result), _fx_catch_30);

   _fx_catch_30: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_57);
      if (v_56) {
         _fx_free_N14K_form__kexp_t(&v_56);
      }
      if (e_idoml_l_0) {
         _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&e_idoml_l_0);
      }
      if (v_55) {
         _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&v_55);
      }
   }
   else if (tag_0 == 22) {
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t v_61 = 0;
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t cases_0 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_62 = {0};
      _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_23 = &e_0->u.KExpMatch;
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lstend_4 = 0;
      FX_COPY_PTR(vcase_23->t0, &cases_0);
      _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lst_5 = cases_0;
      for (; lst_5; lst_5 = lst_5->tl) {
         _fx_LN14K_form__kexp_t checks_i_0 = 0;
         _fx_N14K_form__kexp_t ei_0 = 0;
         _fx_LN14K_form__kexp_t v_63 = 0;
         _fx_N14K_form__kexp_t v_64 = 0;
         _fx_T2LN14K_form__kexp_tN14K_form__kexp_t tup_2 = {0};
         _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* __pat___3 = &lst_5->hd;
         FX_COPY_PTR(__pat___3->t0, &checks_i_0);
         FX_COPY_PTR(__pat___3->t1, &ei_0);
         _fx_LN14K_form__kexp_t lstend_5 = 0;
         _fx_LN14K_form__kexp_t lst_6 = checks_i_0;
         for (; lst_6; lst_6 = lst_6->tl) {
            _fx_N14K_form__kexp_t res_2 = 0;
            _fx_N14K_form__kexp_t cij_0 = lst_6->hd;
            FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(cij_0, callb_0, &res_2, 0),
               _fx_catch_31);
            _fx_LN14K_form__kexp_t node_4 = 0;
            FX_CALL(_fx_cons_LN14K_form__kexp_t(res_2, 0, false, &node_4), _fx_catch_31);
            FX_LIST_APPEND(v_63, lstend_5, node_4);

         _fx_catch_31: ;
            if (res_2) {
               _fx_free_N14K_form__kexp_t(&res_2);
            }
            FX_CHECK_EXN(_fx_catch_32);
         }
         FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(ei_0, callb_0, &v_64, 0),
            _fx_catch_32);
         _fx_make_T2LN14K_form__kexp_tN14K_form__kexp_t(v_63, v_64, &tup_2);
         _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t node_5 = 0;
         FX_CALL(_fx_cons_LT2LN14K_form__kexp_tN14K_form__kexp_t(&tup_2, 0, false, &node_5), _fx_catch_32);
         FX_LIST_APPEND(v_61, lstend_4, node_5);

      _fx_catch_32: ;
         _fx_free_T2LN14K_form__kexp_tN14K_form__kexp_t(&tup_2);
         if (v_64) {
            _fx_free_N14K_form__kexp_t(&v_64);
         }
         if (v_63) {
            _fx_free_LN14K_form__kexp_t(&v_63);
         }
         if (ei_0) {
            _fx_free_N14K_form__kexp_t(&ei_0);
         }
         if (checks_i_0) {
            _fx_free_LN14K_form__kexp_t(&checks_i_0);
         }
         FX_CHECK_EXN(_fx_catch_33);
      }
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(&vcase_23->t1,
            callb_0, &v_62, 0), _fx_catch_33);
      FX_CALL(
         _fx_M6K_formFM9KExpMatchN14K_form__kexp_t2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(v_61,
            &v_62, fx_result), _fx_catch_33);

   _fx_catch_33: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_62);
      if (cases_0) {
         _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&cases_0);
      }
      if (v_61) {
         _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&v_61);
      }
   }
   else if (tag_0 == 23) {
      _fx_N14K_form__kexp_t v_65 = 0;
      _fx_N14K_form__kexp_t v_66 = 0;
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_67 = {0};
      _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_24 = &e_0->u.KExpTryCatch;
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_24->t0, callb_0, &v_65, 0),
         _fx_catch_34);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_24->t1, callb_0, &v_66, 0),
         _fx_catch_34);
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(&vcase_24->t2,
            callb_0, &v_67, 0), _fx_catch_34);
      FX_CALL(
         _fx_M6K_formFM12KExpTryCatchN14K_form__kexp_t3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t(v_65,
            v_66, &v_67, fx_result), _fx_catch_34);

   _fx_catch_34: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_67);
      if (v_66) {
         _fx_free_N14K_form__kexp_t(&v_66);
      }
      if (v_65) {
         _fx_free_N14K_form__kexp_t(&v_65);
      }
   }
   else if (tag_0 == 25) {
      _fx_N14K_form__atom_t v_68 = {0};
      _fx_N14K_form__ktyp_t v_69 = 0;
      _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* vcase_25 = &e_0->u.KExpCast;
      _fx_R10Ast__loc_t* loc_11 = &vcase_25->t2;
      FX_CALL(
         _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(&vcase_25->t0, loc_11, callb_0,
            &v_68, 0), _fx_catch_35);
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(vcase_25->t1, loc_11, callb_0,
            &v_69, 0), _fx_catch_35);
      FX_CALL(
         _fx_M6K_formFM8KExpCastN14K_form__kexp_t3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t(&v_68, v_69, loc_11,
            fx_result), _fx_catch_35);

   _fx_catch_35: ;
      if (v_69) {
         _fx_free_N14K_form__ktyp_t(&v_69);
      }
      _fx_free_N14K_form__atom_t(&v_68);
   }
   else if (tag_0 == 30) {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_70 = {0};
      _fx_T2ST2N14K_form__ktyp_tR10Ast__loc_t* vcase_26 = &e_0->u.KExpCCode;
      FX_CALL(
         _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(&vcase_26->t1,
            callb_0, &v_70, 0), _fx_catch_36);
      FX_CALL(_fx_M6K_formFM9KExpCCodeN14K_form__kexp_t2ST2N14K_form__ktyp_tR10Ast__loc_t(&vcase_26->t0, &v_70, fx_result),
         _fx_catch_36);

   _fx_catch_36: ;
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_70);
   }
   else if (tag_0 == 31) {
      _fx_N14K_form__kexp_t v_71 = 0;
      _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* vcase_27 = &e_0->u.KDefVal;
      _fx_R10Ast__loc_t* loc_12 = &vcase_27->t2;
      _fx_R9Ast__id_t new_kv_name_0;
      FX_CALL(
         _fx_M6K_formFM12update_kval_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&vcase_27->t0, loc_12, callb_0,
            &new_kv_name_0, 0), _fx_catch_37);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(vcase_27->t1, callb_0, &v_71, 0),
         _fx_catch_37);
      FX_CALL(
         _fx_M6K_formFM7KDefValN14K_form__kexp_t3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(&new_kv_name_0, v_71, loc_12,
            fx_result), _fx_catch_37);

   _fx_catch_37: ;
      if (v_71) {
         _fx_free_N14K_form__kexp_t(&v_71);
      }
   }
   else if (tag_0 == 32) {
      _fx_N14K_form__kexp_t kf_body_0 = 0;
      _fx_N14K_form__ktyp_t kf_rt_0 = 0;
      _fx_LR9Ast__id_t kf_params_0 = 0;
      _fx_LR9Ast__id_t v_72 = 0;
      _fx_N14K_form__ktyp_t v_73 = 0;
      _fx_N14K_form__kexp_t v_74 = 0;
      _fx_R17K_form__kdeffun_t new_kf_0 = {0};
      _fx_rR17K_form__kdeffun_t new_kf_1 = 0;
      _fx_N15K_form__kinfo_t v_75 = {0};
      _fx_rR17K_form__kdeffun_t kf_0 = e_0->u.KDefFun;
      _fx_R17K_form__kdeffun_t* v_76 = &kf_0->data;
      _fx_R10Ast__loc_t kf_loc_0 = v_76->kf_loc;
      _fx_R25K_form__kdefclosureinfo_t kf_closure_0 = v_76->kf_closure;
      FX_COPY_PTR(v_76->kf_body, &kf_body_0);
      FX_COPY_PTR(v_76->kf_rt, &kf_rt_0);
      FX_COPY_PTR(v_76->kf_params, &kf_params_0);
      _fx_R9Ast__id_t kf_name_0 = v_76->kf_name;
      _fx_R9Ast__id_t kci_wrap_f_0 = kf_closure_0.kci_wrap_f;
      _fx_R9Ast__id_t kci_make_fp_0 = kf_closure_0.kci_make_fp;
      _fx_R9Ast__id_t kci_fp_typ_0 = kf_closure_0.kci_fp_typ;
      _fx_R9Ast__id_t kci_fcv_t_0 = kf_closure_0.kci_fcv_t;
      _fx_R9Ast__id_t kci_arg_0 = kf_closure_0.kci_arg;
      _fx_R9Ast__id_t new_kf_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kf_name_0, &kf_loc_0, callb_0, &new_kf_name_0,
            0), _fx_catch_38);
      _fx_R9Ast__id_t new_kci_arg_0;
      FX_CALL(
         _fx_M6K_formFM12update_kval_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kci_arg_0, &kf_loc_0, callb_0,
            &new_kci_arg_0, 0), _fx_catch_38);
      _fx_R17K_form__kdeffun_t* v_77 = &kf_0->data;
      FX_CALL(
         _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(kf_params_0, &kf_loc_0, true, callb_0,
            &v_72, 0), _fx_catch_38);
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(kf_rt_0, &kf_loc_0, callb_0,
            &v_73, 0), _fx_catch_38);
      FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(kf_body_0, callb_0, &v_74, 0),
         _fx_catch_38);
      _fx_R9Ast__id_t v_78;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kci_fcv_t_0, &kf_loc_0, callb_0, &v_78, 0),
         _fx_catch_38);
      _fx_R9Ast__id_t v_79;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kci_fp_typ_0, &kf_loc_0, callb_0, &v_79, 0),
         _fx_catch_38);
      _fx_R9Ast__id_t v_80;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kci_make_fp_0, &kf_loc_0, callb_0, &v_80, 0),
         _fx_catch_38);
      _fx_R9Ast__id_t v_81;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kci_wrap_f_0, &kf_loc_0, callb_0, &v_81, 0),
         _fx_catch_38);
      _fx_R25K_form__kdefclosureinfo_t v_82 = { new_kci_arg_0, v_78, v_79, v_80, v_81 };
      _fx_make_R17K_form__kdeffun_t(&new_kf_name_0, &v_77->kf_cname, v_72, v_73, v_74, &v_77->kf_flags, &v_82, v_77->kf_scope,
         &v_77->kf_loc, &new_kf_0);
      bool res_3;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_kf_name_0, &kf_name_0, &res_3, 0), _fx_catch_38);
      if (res_3) {
         _fx_R17K_form__kdeffun_t* v_83 = &kf_0->data;
         _fx_free_R17K_form__kdeffun_t(v_83);
         _fx_copy_R17K_form__kdeffun_t(&new_kf_0, v_83);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR17K_form__kdeffun_t(&new_kf_0, &new_kf_1), _fx_catch_38);
         _fx_M6K_formFM4KFunN15K_form__kinfo_t1rRM9kdeffun_t(new_kf_1, &v_75);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_kf_name_0, &v_75, 0), _fx_catch_38);
         FX_CALL(_fx_M6K_formFM7KDefFunN14K_form__kexp_t1rRM9kdeffun_t(new_kf_1, fx_result), _fx_catch_38);
      }

   _fx_catch_38: ;
      _fx_free_N15K_form__kinfo_t(&v_75);
      if (new_kf_1) {
         _fx_free_rR17K_form__kdeffun_t(&new_kf_1);
      }
      _fx_free_R17K_form__kdeffun_t(&new_kf_0);
      if (v_74) {
         _fx_free_N14K_form__kexp_t(&v_74);
      }
      if (v_73) {
         _fx_free_N14K_form__ktyp_t(&v_73);
      }
      FX_FREE_LIST_SIMPLE(&v_72);
      FX_FREE_LIST_SIMPLE(&kf_params_0);
      if (kf_rt_0) {
         _fx_free_N14K_form__ktyp_t(&kf_rt_0);
      }
      if (kf_body_0) {
         _fx_free_N14K_form__kexp_t(&kf_body_0);
      }
   }
   else if (tag_0 == 33) {
      _fx_N14K_form__ktyp_t ke_typ_0 = 0;
      _fx_N14K_form__ktyp_t v_84 = 0;
      _fx_R17K_form__kdefexn_t new_ke_0 = {0};
      _fx_rR17K_form__kdefexn_t new_ke_1 = 0;
      _fx_N15K_form__kinfo_t v_85 = {0};
      _fx_rR17K_form__kdefexn_t ke_0 = e_0->u.KDefExn;
      _fx_R17K_form__kdefexn_t* v_86 = &ke_0->data;
      _fx_R10Ast__loc_t ke_loc_0 = v_86->ke_loc;
      FX_COPY_PTR(v_86->ke_typ, &ke_typ_0);
      _fx_R9Ast__id_t ke_make_0 = v_86->ke_make;
      _fx_R9Ast__id_t ke_tag_0 = v_86->ke_tag;
      _fx_R9Ast__id_t ke_name_0 = v_86->ke_name;
      _fx_R9Ast__id_t new_ke_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ke_name_0, &ke_loc_0, callb_0, &new_ke_name_0,
            0), _fx_catch_39);
      _fx_R17K_form__kdefexn_t* v_87 = &ke_0->data;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(ke_typ_0, &ke_loc_0, callb_0,
            &v_84, 0), _fx_catch_39);
      _fx_R9Ast__id_t v_88;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ke_tag_0, &ke_loc_0, callb_0, &v_88, 0),
         _fx_catch_39);
      _fx_R9Ast__id_t v_89;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ke_make_0, &ke_loc_0, callb_0, &v_89, 0),
         _fx_catch_39);
      _fx_make_R17K_form__kdefexn_t(&new_ke_name_0, &v_87->ke_cname, &v_87->ke_base_cname, v_84, v_87->ke_std, &v_88, &v_89,
         v_87->ke_scope, &v_87->ke_loc, &new_ke_0);
      bool res_4;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_ke_name_0, &ke_name_0, &res_4, 0), _fx_catch_39);
      if (res_4) {
         _fx_R17K_form__kdefexn_t* v_90 = &ke_0->data;
         _fx_free_R17K_form__kdefexn_t(v_90);
         _fx_copy_R17K_form__kdefexn_t(&new_ke_0, v_90);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR17K_form__kdefexn_t(&new_ke_0, &new_ke_1), _fx_catch_39);
         _fx_M6K_formFM4KExnN15K_form__kinfo_t1rRM9kdefexn_t(new_ke_1, &v_85);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_ke_name_0, &v_85, 0), _fx_catch_39);
         FX_CALL(_fx_M6K_formFM7KDefExnN14K_form__kexp_t1rRM9kdefexn_t(new_ke_1, fx_result), _fx_catch_39);
      }

   _fx_catch_39: ;
      _fx_free_N15K_form__kinfo_t(&v_85);
      if (new_ke_1) {
         _fx_free_rR17K_form__kdefexn_t(&new_ke_1);
      }
      _fx_free_R17K_form__kdefexn_t(&new_ke_0);
      if (v_84) {
         _fx_free_N14K_form__ktyp_t(&v_84);
      }
      if (ke_typ_0) {
         _fx_free_N14K_form__ktyp_t(&ke_typ_0);
      }
   }
   else if (tag_0 == 34) {
      _fx_LR9Ast__id_t kvar_ctors_0 = 0;
      _fx_LT2R9Ast__id_tLR9Ast__id_t kvar_ifaces_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_91 = 0;
      _fx_LR9Ast__id_t v_92 = 0;
      _fx_LT2R9Ast__id_tLR9Ast__id_t v_93 = 0;
      _fx_R21K_form__kdefvariant_t new_kvar_0 = {0};
      _fx_rR21K_form__kdefvariant_t new_kvar_1 = 0;
      _fx_N15K_form__kinfo_t v_94 = {0};
      _fx_rR21K_form__kdefvariant_t kvar_0 = e_0->u.KDefVariant;
      _fx_R21K_form__kdefvariant_t* v_95 = &kvar_0->data;
      _fx_R10Ast__loc_t kvar_loc_0 = v_95->kvar_loc;
      FX_COPY_PTR(v_95->kvar_ctors, &kvar_ctors_0);
      FX_COPY_PTR(v_95->kvar_ifaces, &kvar_ifaces_0);
      FX_COPY_PTR(v_95->kvar_cases, &kvar_cases_0);
      _fx_R9Ast__id_t kvar_name_0 = v_95->kvar_name;
      _fx_R9Ast__id_t new_kvar_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kvar_name_0, &kvar_loc_0, callb_0,
            &new_kvar_name_0, 0), _fx_catch_45);
      _fx_R21K_form__kdefvariant_t* v_96 = &kvar_0->data;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_6 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_7 = kvar_cases_0;
      for (; lst_7; lst_7 = lst_7->tl) {
         _fx_N14K_form__ktyp_t t_0 = 0;
         _fx_N14K_form__ktyp_t v_97 = 0;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_3 = {0};
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___4 = &lst_7->hd;
         _fx_R9Ast__id_t n_0 = __pat___4->t0;
         FX_COPY_PTR(__pat___4->t1, &t_0);
         _fx_R9Ast__id_t v_98;
         FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&n_0, &kvar_loc_0, callb_0, &v_98, 0),
            _fx_catch_40);
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_0, &kvar_loc_0, callb_0,
               &v_97, 0), _fx_catch_40);
         _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&v_98, v_97, &tup_3);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_6 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_3, 0, false, &node_6), _fx_catch_40);
         FX_LIST_APPEND(v_91, lstend_6, node_6);

      _fx_catch_40: ;
         _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_3);
         if (v_97) {
            _fx_free_N14K_form__ktyp_t(&v_97);
         }
         if (t_0) {
            _fx_free_N14K_form__ktyp_t(&t_0);
         }
         FX_CHECK_EXN(_fx_catch_45);
      }
      _fx_LR9Ast__id_t lstend_7 = 0;
      _fx_LR9Ast__id_t lst_8 = kvar_ctors_0;
      for (; lst_8; lst_8 = lst_8->tl) {
         _fx_N15K_form__kinfo_t v_99 = {0};
         _fx_R9Ast__id_t* c_0 = &lst_8->hd;
         FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(c_0, &kvar_loc_0, &v_99, 0), _fx_catch_43);
         _fx_R9Ast__id_t res_5;
         if (v_99.tag == 2) {
            FX_CALL(
               _fx_M6K_formFM12update_kval_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(c_0, &kvar_loc_0, callb_0, &res_5,
                  0), _fx_catch_41);

         _fx_catch_41: ;
         }
         else {
            FX_CALL(
               _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(c_0, &kvar_loc_0, callb_0, &res_5, 0),
               _fx_catch_42);

         _fx_catch_42: ;
         }
         FX_CHECK_EXN(_fx_catch_43);
         _fx_LR9Ast__id_t node_7 = 0;
         FX_CALL(_fx_cons_LR9Ast__id_t(&res_5, 0, false, &node_7), _fx_catch_43);
         FX_LIST_APPEND(v_92, lstend_7, node_7);

      _fx_catch_43: ;
         _fx_free_N15K_form__kinfo_t(&v_99);
         FX_CHECK_EXN(_fx_catch_45);
      }
      _fx_LT2R9Ast__id_tLR9Ast__id_t lstend_8 = 0;
      _fx_LT2R9Ast__id_tLR9Ast__id_t lst_9 = kvar_ifaces_0;
      for (; lst_9; lst_9 = lst_9->tl) {
         _fx_LR9Ast__id_t meths_0 = 0;
         _fx_LR9Ast__id_t v_100 = 0;
         _fx_T2R9Ast__id_tLR9Ast__id_t tup_4 = {0};
         _fx_T2R9Ast__id_tLR9Ast__id_t* __pat___5 = &lst_9->hd;
         _fx_R9Ast__id_t iname_0 = __pat___5->t0;
         FX_COPY_PTR(__pat___5->t1, &meths_0);
         _fx_R9Ast__id_t v_101;
         FX_CALL(
            _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&iname_0, &kvar_loc_0, callb_0, &v_101, 0),
            _fx_catch_44);
         FX_CALL(
            _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(meths_0, &kvar_loc_0, false,
               callb_0, &v_100, 0), _fx_catch_44);
         _fx_make_T2R9Ast__id_tLR9Ast__id_t(&v_101, v_100, &tup_4);
         _fx_LT2R9Ast__id_tLR9Ast__id_t node_8 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tLR9Ast__id_t(&tup_4, 0, false, &node_8), _fx_catch_44);
         FX_LIST_APPEND(v_93, lstend_8, node_8);

      _fx_catch_44: ;
         _fx_free_T2R9Ast__id_tLR9Ast__id_t(&tup_4);
         FX_FREE_LIST_SIMPLE(&v_100);
         FX_FREE_LIST_SIMPLE(&meths_0);
         FX_CHECK_EXN(_fx_catch_45);
      }
      _fx_make_R21K_form__kdefvariant_t(&new_kvar_name_0, &v_96->kvar_cname, &v_96->kvar_proto, &v_96->kvar_props,
         v_96->kvar_targs, v_91, v_92, &v_96->kvar_flags, v_93, v_96->kvar_scope, &v_96->kvar_loc, &new_kvar_0);
      bool res_6;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_kvar_name_0, &kvar_name_0, &res_6, 0), _fx_catch_45);
      if (res_6) {
         _fx_R21K_form__kdefvariant_t* v_102 = &kvar_0->data;
         _fx_free_R21K_form__kdefvariant_t(v_102);
         _fx_copy_R21K_form__kdefvariant_t(&new_kvar_0, v_102);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR21K_form__kdefvariant_t(&new_kvar_0, &new_kvar_1), _fx_catch_45);
         _fx_M6K_formFM8KVariantN15K_form__kinfo_t1rRM13kdefvariant_t(new_kvar_1, &v_94);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_kvar_name_0, &v_94, 0), _fx_catch_45);
         FX_CALL(_fx_M6K_formFM11KDefVariantN14K_form__kexp_t1rRM13kdefvariant_t(new_kvar_1, fx_result), _fx_catch_45);
      }

   _fx_catch_45: ;
      _fx_free_N15K_form__kinfo_t(&v_94);
      if (new_kvar_1) {
         _fx_free_rR21K_form__kdefvariant_t(&new_kvar_1);
      }
      _fx_free_R21K_form__kdefvariant_t(&new_kvar_0);
      if (v_93) {
         _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&v_93);
      }
      FX_FREE_LIST_SIMPLE(&v_92);
      if (v_91) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_91);
      }
      if (kvar_cases_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
      }
      if (kvar_ifaces_0) {
         _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&kvar_ifaces_0);
      }
      FX_FREE_LIST_SIMPLE(&kvar_ctors_0);
   }
   else if (tag_0 == 36) {
      _fx_N14K_form__ktyp_t kt_typ_0 = 0;
      _fx_N14K_form__ktyp_t v_103 = 0;
      _fx_R17K_form__kdeftyp_t new_kt_0 = {0};
      _fx_rR17K_form__kdeftyp_t new_kt_1 = 0;
      _fx_N15K_form__kinfo_t v_104 = {0};
      _fx_rR17K_form__kdeftyp_t kt_0 = e_0->u.KDefTyp;
      _fx_R17K_form__kdeftyp_t* v_105 = &kt_0->data;
      _fx_R10Ast__loc_t kt_loc_0 = v_105->kt_loc;
      FX_COPY_PTR(v_105->kt_typ, &kt_typ_0);
      _fx_R9Ast__id_t kt_name_0 = v_105->kt_name;
      _fx_R9Ast__id_t new_kt_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kt_name_0, &kt_loc_0, callb_0, &new_kt_name_0,
            0), _fx_catch_46);
      _fx_R17K_form__kdeftyp_t* v_106 = &kt_0->data;
      FX_CALL(
         _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(kt_typ_0, &kt_loc_0, callb_0,
            &v_103, 0), _fx_catch_46);
      _fx_make_R17K_form__kdeftyp_t(&new_kt_name_0, &v_106->kt_cname, &v_106->kt_proto, &v_106->kt_props, v_106->kt_targs,
         v_103, v_106->kt_scope, &v_106->kt_loc, &new_kt_0);
      bool res_7;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_kt_name_0, &kt_name_0, &res_7, 0), _fx_catch_46);
      if (res_7) {
         _fx_R17K_form__kdeftyp_t* v_107 = &kt_0->data;
         _fx_free_R17K_form__kdeftyp_t(v_107);
         _fx_copy_R17K_form__kdeftyp_t(&new_kt_0, v_107);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR17K_form__kdeftyp_t(&new_kt_0, &new_kt_1), _fx_catch_46);
         _fx_M6K_formFM4KTypN15K_form__kinfo_t1rRM9kdeftyp_t(new_kt_1, &v_104);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_kt_name_0, &v_104, 0), _fx_catch_46);
         FX_CALL(_fx_M6K_formFM7KDefTypN14K_form__kexp_t1rRM9kdeftyp_t(new_kt_1, fx_result), _fx_catch_46);
      }

   _fx_catch_46: ;
      _fx_free_N15K_form__kinfo_t(&v_104);
      if (new_kt_1) {
         _fx_free_rR17K_form__kdeftyp_t(&new_kt_1);
      }
      _fx_free_R17K_form__kdeftyp_t(&new_kt_0);
      if (v_103) {
         _fx_free_N14K_form__ktyp_t(&v_103);
      }
      if (kt_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kt_typ_0);
      }
   }
   else if (tag_0 == 35) {
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t ki_all_methods_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_108 = 0;
      _fx_R23K_form__kdefinterface_t new_ki_0 = {0};
      _fx_rR23K_form__kdefinterface_t new_ki_1 = 0;
      _fx_N15K_form__kinfo_t v_109 = {0};
      _fx_rR23K_form__kdefinterface_t ki_0 = e_0->u.KDefInterface;
      _fx_R23K_form__kdefinterface_t* v_110 = &ki_0->data;
      _fx_R10Ast__loc_t ki_loc_0 = v_110->ki_loc;
      FX_COPY_PTR(v_110->ki_all_methods, &ki_all_methods_0);
      _fx_R9Ast__id_t ki_id_0 = v_110->ki_id;
      _fx_R9Ast__id_t ki_base_0 = v_110->ki_base;
      _fx_R9Ast__id_t ki_name_0 = v_110->ki_name;
      _fx_R9Ast__id_t new_ki_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ki_name_0, &ki_loc_0, callb_0, &new_ki_name_0,
            0), _fx_catch_48);
      _fx_R23K_form__kdefinterface_t* v_111 = &ki_0->data;
      _fx_R9Ast__id_t v_112;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ki_base_0, &ki_loc_0, callb_0, &v_112, 0),
         _fx_catch_48);
      _fx_R9Ast__id_t v_113;
      FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&ki_id_0, &ki_loc_0, callb_0, &v_113, 0),
         _fx_catch_48);
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_9 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_10 = ki_all_methods_0;
      for (; lst_10; lst_10 = lst_10->tl) {
         _fx_N14K_form__ktyp_t t_1 = 0;
         _fx_N14K_form__ktyp_t v_114 = 0;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_5 = {0};
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___6 = &lst_10->hd;
         _fx_R9Ast__id_t f_0 = __pat___6->t0;
         FX_COPY_PTR(__pat___6->t1, &t_1);
         _fx_R9Ast__id_t v_115;
         FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&f_0, &ki_loc_0, callb_0, &v_115, 0),
            _fx_catch_47);
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_1, &ki_loc_0, callb_0,
               &v_114, 0), _fx_catch_47);
         _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&v_115, v_114, &tup_5);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_9 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_5, 0, false, &node_9), _fx_catch_47);
         FX_LIST_APPEND(v_108, lstend_9, node_9);

      _fx_catch_47: ;
         _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_5);
         if (v_114) {
            _fx_free_N14K_form__ktyp_t(&v_114);
         }
         if (t_1) {
            _fx_free_N14K_form__ktyp_t(&t_1);
         }
         FX_CHECK_EXN(_fx_catch_48);
      }
      _fx_make_R23K_form__kdefinterface_t(&new_ki_name_0, &v_112, &v_111->ki_cname, &v_113, v_108, v_111->ki_scope,
         &v_111->ki_loc, &new_ki_0);
      bool res_8;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_ki_name_0, &ki_name_0, &res_8, 0), _fx_catch_48);
      if (res_8) {
         _fx_R23K_form__kdefinterface_t* v_116 = &ki_0->data;
         _fx_free_R23K_form__kdefinterface_t(v_116);
         _fx_copy_R23K_form__kdefinterface_t(&new_ki_0, v_116);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR23K_form__kdefinterface_t(&new_ki_0, &new_ki_1), _fx_catch_48);
         _fx_M6K_formFM10KInterfaceN15K_form__kinfo_t1rRM15kdefinterface_t(new_ki_1, &v_109);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_ki_name_0, &v_109, 0), _fx_catch_48);
         FX_CALL(_fx_M6K_formFM13KDefInterfaceN14K_form__kexp_t1rRM15kdefinterface_t(new_ki_1, fx_result), _fx_catch_48);
      }

   _fx_catch_48: ;
      _fx_free_N15K_form__kinfo_t(&v_109);
      if (new_ki_1) {
         _fx_free_rR23K_form__kdefinterface_t(&new_ki_1);
      }
      _fx_free_R23K_form__kdefinterface_t(&new_ki_0);
      if (v_108) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_108);
      }
      if (ki_all_methods_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&ki_all_methods_0);
      }
   }
   else if (tag_0 == 37) {
      _fx_LR9Ast__id_t kcv_orig_freevars_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t kcv_freevars_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t v_117 = 0;
      _fx_LR9Ast__id_t v_118 = 0;
      _fx_R25K_form__kdefclosurevars_t new_kcv_0 = {0};
      _fx_rR25K_form__kdefclosurevars_t new_kcv_1 = 0;
      _fx_N15K_form__kinfo_t v_119 = {0};
      _fx_rR25K_form__kdefclosurevars_t kcv_0 = e_0->u.KDefClosureVars;
      _fx_R25K_form__kdefclosurevars_t* v_120 = &kcv_0->data;
      _fx_R10Ast__loc_t kcv_loc_0 = v_120->kcv_loc;
      FX_COPY_PTR(v_120->kcv_orig_freevars, &kcv_orig_freevars_0);
      FX_COPY_PTR(v_120->kcv_freevars, &kcv_freevars_0);
      _fx_R9Ast__id_t kcv_name_0 = v_120->kcv_name;
      _fx_R9Ast__id_t new_kcv_name_0;
      FX_CALL(
         _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&kcv_name_0, &kcv_loc_0, callb_0,
            &new_kcv_name_0, 0), _fx_catch_50);
      _fx_R25K_form__kdefclosurevars_t* v_121 = &kcv_0->data;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lstend_10 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_11 = kcv_freevars_0;
      for (; lst_11; lst_11 = lst_11->tl) {
         _fx_N14K_form__ktyp_t t_2 = 0;
         _fx_N14K_form__ktyp_t v_122 = 0;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t tup_6 = {0};
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___7 = &lst_11->hd;
         _fx_R9Ast__id_t n_1 = __pat___7->t0;
         FX_COPY_PTR(__pat___7->t1, &t_2);
         _fx_R9Ast__id_t v_123;
         FX_CALL(_fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(&n_1, &kcv_loc_0, callb_0, &v_123, 0),
            _fx_catch_49);
         FX_CALL(
            _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_2, &kcv_loc_0, callb_0,
               &v_122, 0), _fx_catch_49);
         _fx_make_T2R9Ast__id_tN14K_form__ktyp_t(&v_123, v_122, &tup_6);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t node_10 = 0;
         FX_CALL(_fx_cons_LT2R9Ast__id_tN14K_form__ktyp_t(&tup_6, 0, false, &node_10), _fx_catch_49);
         FX_LIST_APPEND(v_117, lstend_10, node_10);

      _fx_catch_49: ;
         _fx_free_T2R9Ast__id_tN14K_form__ktyp_t(&tup_6);
         if (v_122) {
            _fx_free_N14K_form__ktyp_t(&v_122);
         }
         if (t_2) {
            _fx_free_N14K_form__ktyp_t(&t_2);
         }
         FX_CHECK_EXN(_fx_catch_50);
      }
      FX_CALL(
         _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(kcv_orig_freevars_0, &kcv_loc_0, false,
            callb_0, &v_118, 0), _fx_catch_50);
      _fx_make_R25K_form__kdefclosurevars_t(&new_kcv_name_0, &v_121->kcv_cname, v_117, v_118, v_121->kcv_scope, &v_121->kcv_loc,
         &new_kcv_0);
      bool res_9;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&new_kcv_name_0, &kcv_name_0, &res_9, 0), _fx_catch_50);
      if (res_9) {
         _fx_R25K_form__kdefclosurevars_t* v_124 = &kcv_0->data;
         _fx_free_R25K_form__kdefclosurevars_t(v_124);
         _fx_copy_R25K_form__kdefclosurevars_t(&new_kcv_0, v_124);
         FX_COPY_PTR(e_0, fx_result);
      }
      else {
         FX_CALL(_fx_make_rR25K_form__kdefclosurevars_t(&new_kcv_0, &new_kcv_1), _fx_catch_50);
         _fx_M6K_formFM12KClosureVarsN15K_form__kinfo_t1rRM17kdefclosurevars_t(new_kcv_1, &v_119);
         FX_CALL(_fx_M6K_formFM13set_idk_entryv2R9Ast__id_tN15K_form__kinfo_t(&new_kcv_name_0, &v_119, 0), _fx_catch_50);
         FX_CALL(_fx_M6K_formFM15KDefClosureVarsN14K_form__kexp_t1rRM17kdefclosurevars_t(new_kcv_1, fx_result), _fx_catch_50);
      }

   _fx_catch_50: ;
      _fx_free_N15K_form__kinfo_t(&v_119);
      if (new_kcv_1) {
         _fx_free_rR25K_form__kdefclosurevars_t(&new_kcv_1);
      }
      _fx_free_R25K_form__kdefclosurevars_t(&new_kcv_0);
      FX_FREE_LIST_SIMPLE(&v_118);
      if (v_117) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&v_117);
      }
      if (kcv_freevars_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kcv_freevars_0);
      }
      FX_FREE_LIST_SIMPLE(&kcv_orig_freevars_0);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10walk_atom_N14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__atom_t* fx_result,
   void* fx_fv)
{
   _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(a_0, loc_0, callb_0, fx_result, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      if (a_0->tag == 2) {
         _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
         if (v_1->tag == 8) {
            _fx_N14K_form__ktyp_t v_2 = 0;
            _fx_N14K_form__klit_t v_3 = {0};
            FX_CALL(
               _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_1->u.KLitNil,
                  loc_0, callb_0, &v_2, 0), _fx_catch_1);
            _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_2, &v_3);
            _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_3, fx_result);

         _fx_catch_1: ;
            _fx_free_N14K_form__klit_t(&v_3);
            if (v_2) {
               _fx_free_N14K_form__ktyp_t(&v_2);
            }
            goto _fx_endmatch_0;
         }
      }
      _fx_copy_N14K_form__atom_t(a_0, fx_result);

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
   }
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
   }
   return fx_status;
}

static int _fx_M6K_formFM8walk_al_LN14K_form__atom_t3LN14K_form__atom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_LN14K_form__atom_t_data_t* al_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LN14K_form__atom_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LN14K_form__atom_t lstend_0 = 0;
   _fx_LN14K_form__atom_t lst_0 = al_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
      _fx_N14K_form__atom_t res_0 = {0};
      _fx_N14K_form__atom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(callb_0->kcb_atom, &v_0);
      if ((v_0 != 0) + 1 == 2) {
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
         FX_CALL(f_0->fp(a_0, loc_0, callb_0, &res_0, f_0->fcv), _fx_catch_0);

      _fx_catch_0: ;
      }
      else {
         if (a_0->tag == 2) {
            _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
            if (v_1->tag == 8) {
               _fx_N14K_form__ktyp_t v_2 = 0;
               _fx_N14K_form__klit_t v_3 = {0};
               FX_CALL(
                  _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(v_1->u.KLitNil,
                     loc_0, callb_0, &v_2, 0), _fx_catch_1);
               _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(v_2, &v_3);
               _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&v_3, &res_0);

            _fx_catch_1: ;
               _fx_free_N14K_form__klit_t(&v_3);
               if (v_2) {
                  _fx_free_N14K_form__ktyp_t(&v_2);
               }
               goto _fx_endmatch_0;
            }
         }
         _fx_copy_N14K_form__atom_t(a_0, &res_0);

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_2);

      _fx_catch_2: ;
      }
      FX_CHECK_EXN(_fx_catch_3);
      _fx_LN14K_form__atom_t node_0 = 0;
      FX_CALL(_fx_cons_LN14K_form__atom_t(&res_0, 0, false, &node_0), _fx_catch_3);
      FX_LIST_APPEND(*fx_result, lstend_0, node_0);

   _fx_catch_3: ;
      _fx_free_N14K_form__atom_t(&res_0);
      if (v_0) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10walk_ktyp_N14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(
      _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_0, loc_0, callb_0,
         fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM8walk_id_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_N14K_form__atom_t v_1 = {0};
      _fx_N14K_form__atom_t v_2 = {0};
      _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_1);
      FX_CALL(f_0->fp(&v_1, loc_0, callb_0, &v_2, f_0->fcv), _fx_catch_1);
      if (v_2.tag == 1) {
         *fx_result = v_2.u.AtomId;
      }
      else {
         fx_exn_t v_3 = {0};
         fx_str_t slit_0 =
            FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_3, 0), _fx_catch_0);
         FX_THROW(&v_3, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_3);
      }
      FX_CHECK_EXN(_fx_catch_1);

   _fx_catch_1: ;
      _fx_free_N14K_form__atom_t(&v_2);
      _fx_free_N14K_form__atom_t(&v_1);
   }
   else {
      *fx_result = *n_0;
   }
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
   }
   return fx_status;
}

static int _fx_M6K_formFM12walk_idlist_LR9Ast__id_t4LR9Ast__id_tR10Ast__loc_tBRM9k_callb_t(
   struct _fx_LR9Ast__id_t_data_t* nl_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool update_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LR9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LR9Ast__id_t lstend_0 = 0;
   _fx_LR9Ast__id_t lst_0 = nl_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_R17K_form__kdefval_t kv_0 = {0};
      _fx_N14K_form__ktyp_t kv_typ_0 = 0;
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
      _fx_N14K_form__ktyp_t new_kv_typ_0 = 0;
      _fx_R17K_form__kdefval_t v_1 = {0};
      _fx_N15K_form__kinfo_t v_2 = {0};
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_3 = 0;
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_4 = 0;
      _fx_R9Ast__id_t* n_0 = &lst_0->hd;
      _fx_R9Ast__id_t t_0;
      if (update_0) {
         bool t_1;
         if (n_0->m > 0) {
            t_1 = n_0->i > 0;
         }
         else {
            t_1 = false;
         }
         if (t_1) {
            FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(n_0, loc_0, &kv_0, 0), _fx_catch_6);
            FX_COPY_PTR(kv_0.kv_typ, &kv_typ_0);
            _fx_R9Ast__id_t kv_name_0 = kv_0.kv_name;
            FX_COPY_PTR(callb_0->kcb_atom, &v_0);
            _fx_R9Ast__id_t new_kv_name_0;
            if ((v_0 != 0) + 1 == 2) {
               _fx_N14K_form__atom_t v_5 = {0};
               _fx_N14K_form__atom_t v_6 = {0};
               _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&kv_name_0, &v_5);
               FX_CALL(f_0->fp(&v_5, loc_0, callb_0, &v_6, f_0->fcv), _fx_catch_1);
               if (v_6.tag == 1) {
                  new_kv_name_0 = v_6.u.AtomId;
               }
               else {
                  fx_exn_t v_7 = {0};
                  fx_str_t slit_0 =
                     FX_MAKE_STR(
                        "internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_7, 0), _fx_catch_0);
                  FX_THROW(&v_7, false, _fx_catch_0);

               _fx_catch_0: ;
                  fx_free_exn(&v_7);
               }
               FX_CHECK_EXN(_fx_catch_1);

            _fx_catch_1: ;
               _fx_free_N14K_form__atom_t(&v_6);
               _fx_free_N14K_form__atom_t(&v_5);
            }
            else {
               new_kv_name_0 = kv_name_0;
            }
            FX_CHECK_EXN(_fx_catch_6);
            FX_CALL(
               _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(kv_typ_0, loc_0,
                  callb_0, &new_kv_typ_0, 0), _fx_catch_6);
            _fx_make_R17K_form__kdefval_t(&new_kv_name_0, &kv_0.kv_cname, new_kv_typ_0, &kv_0.kv_flags, &kv_0.kv_loc, &v_1);
            _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&v_1, &v_2);
            _fx_Ta2i v_8;
            FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(&new_kv_name_0, &_fx_g10Ast__noloc, &v_8, 0), _fx_catch_6);
            int_ m_0 = v_8.t0;
            int_ j_0 = v_8.t1;
            FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_6);
            FX_CHKIDX(
               FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
               _fx_catch_6);
            _fx_N15K_form__kinfo_t* v_9 =
               FX_PTR_1D(_fx_N15K_form__kinfo_t,
                  (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0);
            _fx_free_N15K_form__kinfo_t(v_9);
            _fx_copy_N15K_form__kinfo_t(&v_2, v_9);
            t_0 = new_kv_name_0;
         }
         else {
            FX_COPY_PTR(callb_0->kcb_atom, &v_3);
            if ((v_3 != 0) + 1 == 2) {
               _fx_N14K_form__atom_t v_10 = {0};
               _fx_N14K_form__atom_t v_11 = {0};
               _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_1 = &v_3->u.Some;
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_10);
               FX_CALL(f_1->fp(&v_10, loc_0, callb_0, &v_11, f_1->fcv), _fx_catch_3);
               if (v_11.tag == 1) {
                  t_0 = v_11.u.AtomId;
               }
               else {
                  fx_exn_t v_12 = {0};
                  fx_str_t slit_1 =
                     FX_MAKE_STR(
                        "internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
                  FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_12, 0), _fx_catch_2);
                  FX_THROW(&v_12, false, _fx_catch_2);

               _fx_catch_2: ;
                  fx_free_exn(&v_12);
               }
               FX_CHECK_EXN(_fx_catch_3);

            _fx_catch_3: ;
               _fx_free_N14K_form__atom_t(&v_11);
               _fx_free_N14K_form__atom_t(&v_10);
            }
            else {
               t_0 = *n_0;
            }
            FX_CHECK_EXN(_fx_catch_6);
         }
      }
      else {
         FX_COPY_PTR(callb_0->kcb_atom, &v_4);
         if ((v_4 != 0) + 1 == 2) {
            _fx_N14K_form__atom_t v_13 = {0};
            _fx_N14K_form__atom_t v_14 = {0};
            _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_2 = &v_4->u.Some;
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_13);
            FX_CALL(f_2->fp(&v_13, loc_0, callb_0, &v_14, f_2->fcv), _fx_catch_5);
            if (v_14.tag == 1) {
               t_0 = v_14.u.AtomId;
            }
            else {
               fx_exn_t v_15 = {0};
               fx_str_t slit_2 =
                  FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_15, 0), _fx_catch_4);
               FX_THROW(&v_15, false, _fx_catch_4);

            _fx_catch_4: ;
               fx_free_exn(&v_15);
            }
            FX_CHECK_EXN(_fx_catch_5);

         _fx_catch_5: ;
            _fx_free_N14K_form__atom_t(&v_14);
            _fx_free_N14K_form__atom_t(&v_13);
         }
         else {
            t_0 = *n_0;
         }
         FX_CHECK_EXN(_fx_catch_6);
      }
      _fx_LR9Ast__id_t node_0 = 0;
      FX_CALL(_fx_cons_LR9Ast__id_t(&t_0, 0, false, &node_0), _fx_catch_6);
      FX_LIST_APPEND(*fx_result, lstend_0, node_0);

   _fx_catch_6: ;
      if (v_4) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_4);
      }
      if (v_3) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_3);
      }
      _fx_free_N15K_form__kinfo_t(&v_2);
      _fx_free_R17K_form__kdefval_t(&v_1);
      if (new_kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&new_kv_typ_0);
      }
      if (v_0) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
      }
      if (kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kv_typ_0);
      }
      _fx_free_R17K_form__kdefval_t(&kv_0);
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(_fx_M6K_formFM17check_n_walk_kexpN14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(e_0, callb_0, fx_result, 0),
      _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10walk_kctx_T2N14K_form__ktyp_tR10Ast__loc_t2T2N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* arg0_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_T2N14K_form__ktyp_tR10Ast__loc_t* fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t t_0 = 0;
   _fx_N14K_form__ktyp_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(arg0_0->t0, &t_0);
   _fx_R10Ast__loc_t loc_0 = arg0_0->t1;
   FX_CALL(
      _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(t_0, &loc_0, callb_0, &v_0,
         0), _fx_cleanup);
   _fx_make_T2N14K_form__ktyp_tR10Ast__loc_t(v_0, &loc_0, fx_result);

_fx_cleanup: ;
   if (t_0) {
      _fx_free_N14K_form__ktyp_t(&t_0);
   }
   if (v_0) {
      _fx_free_N14K_form__ktyp_t(&v_0);
   }
   return fx_status;
}

static int _fx_M6K_formFM9walk_dom_N13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_N13K_form__dom_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(
      _fx_M6K_formFM16check_n_walk_domN13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(d_0, loc_0, callb_0, fx_result,
         0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM14walk_idomlist_LT2R9Ast__id_tN13K_form__dom_t3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* idoml_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t** fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LT2R9Ast__id_tN13K_form__dom_t lstend_0 = 0;
   _fx_LT2R9Ast__id_tN13K_form__dom_t lst_0 = idoml_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N13K_form__dom_t d_0 = {0};
      _fx_R17K_form__kdefval_t kv_0 = {0};
      _fx_N14K_form__ktyp_t kv_typ_0 = 0;
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
      _fx_N14K_form__ktyp_t new_kv_typ_0 = 0;
      _fx_R17K_form__kdefval_t v_1 = {0};
      _fx_N15K_form__kinfo_t v_2 = {0};
      _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_3 = 0;
      _fx_N13K_form__dom_t v_4 = {0};
      _fx_T2R9Ast__id_tN13K_form__dom_t tup_0 = {0};
      _fx_T2R9Ast__id_tN13K_form__dom_t* __pat___0 = &lst_0->hd;
      _fx_R9Ast__id_t n_0 = __pat___0->t0;
      _fx_copy_N13K_form__dom_t(&__pat___0->t1, &d_0);
      bool t_0;
      if (n_0.m > 0) {
         t_0 = n_0.i > 0;
      }
      else {
         t_0 = false;
      }
      _fx_R9Ast__id_t n_1;
      if (t_0) {
         FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(&n_0, loc_0, &kv_0, 0), _fx_catch_4);
         FX_COPY_PTR(kv_0.kv_typ, &kv_typ_0);
         _fx_R9Ast__id_t kv_name_0 = kv_0.kv_name;
         FX_COPY_PTR(callb_0->kcb_atom, &v_0);
         _fx_R9Ast__id_t new_kv_name_0;
         if ((v_0 != 0) + 1 == 2) {
            _fx_N14K_form__atom_t v_5 = {0};
            _fx_N14K_form__atom_t v_6 = {0};
            _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&kv_name_0, &v_5);
            FX_CALL(f_0->fp(&v_5, loc_0, callb_0, &v_6, f_0->fcv), _fx_catch_1);
            if (v_6.tag == 1) {
               new_kv_name_0 = v_6.u.AtomId;
            }
            else {
               fx_exn_t v_7 = {0};
               fx_str_t slit_0 =
                  FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_7, 0), _fx_catch_0);
               FX_THROW(&v_7, false, _fx_catch_0);

            _fx_catch_0: ;
               fx_free_exn(&v_7);
            }
            FX_CHECK_EXN(_fx_catch_1);

         _fx_catch_1: ;
            _fx_free_N14K_form__atom_t(&v_6);
            _fx_free_N14K_form__atom_t(&v_5);
         }
         else {
            new_kv_name_0 = kv_name_0;
         }
         FX_CHECK_EXN(_fx_catch_4);
         FX_CALL(
            _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(kv_typ_0, loc_0,
               callb_0, &new_kv_typ_0, 0), _fx_catch_4);
         _fx_make_R17K_form__kdefval_t(&new_kv_name_0, &kv_0.kv_cname, new_kv_typ_0, &kv_0.kv_flags, &kv_0.kv_loc, &v_1);
         _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&v_1, &v_2);
         _fx_Ta2i v_8;
         FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(&new_kv_name_0, &_fx_g10Ast__noloc, &v_8, 0), _fx_catch_4);
         int_ m_0 = v_8.t0;
         int_ j_0 = v_8.t1;
         FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_4);
         FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
            _fx_catch_4);
         _fx_N15K_form__kinfo_t* v_9 =
            FX_PTR_1D(_fx_N15K_form__kinfo_t,
               (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0);
         _fx_free_N15K_form__kinfo_t(v_9);
         _fx_copy_N15K_form__kinfo_t(&v_2, v_9);
         n_1 = new_kv_name_0;
      }
      else {
         FX_COPY_PTR(callb_0->kcb_atom, &v_3);
         if ((v_3 != 0) + 1 == 2) {
            _fx_N14K_form__atom_t v_10 = {0};
            _fx_N14K_form__atom_t v_11 = {0};
            _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_1 = &v_3->u.Some;
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&n_0, &v_10);
            FX_CALL(f_1->fp(&v_10, loc_0, callb_0, &v_11, f_1->fcv), _fx_catch_3);
            if (v_11.tag == 1) {
               n_1 = v_11.u.AtomId;
            }
            else {
               fx_exn_t v_12 = {0};
               fx_str_t slit_1 =
                  FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
               FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_12, 0), _fx_catch_2);
               FX_THROW(&v_12, false, _fx_catch_2);

            _fx_catch_2: ;
               fx_free_exn(&v_12);
            }
            FX_CHECK_EXN(_fx_catch_3);

         _fx_catch_3: ;
            _fx_free_N14K_form__atom_t(&v_11);
            _fx_free_N14K_form__atom_t(&v_10);
         }
         else {
            n_1 = n_0;
         }
         FX_CHECK_EXN(_fx_catch_4);
      }
      FX_CALL(
         _fx_M6K_formFM16check_n_walk_domN13K_form__dom_t3N13K_form__dom_tR10Ast__loc_tRM9k_callb_t(&d_0, loc_0, callb_0, &v_4,
            0), _fx_catch_4);
      _fx_make_T2R9Ast__id_tN13K_form__dom_t(&n_1, &v_4, &tup_0);
      _fx_LT2R9Ast__id_tN13K_form__dom_t node_0 = 0;
      FX_CALL(_fx_cons_LT2R9Ast__id_tN13K_form__dom_t(&tup_0, 0, false, &node_0), _fx_catch_4);
      FX_LIST_APPEND(*fx_result, lstend_0, node_0);

   _fx_catch_4: ;
      _fx_free_T2R9Ast__id_tN13K_form__dom_t(&tup_0);
      _fx_free_N13K_form__dom_t(&v_4);
      if (v_3) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_3);
      }
      _fx_free_N15K_form__kinfo_t(&v_2);
      _fx_free_R17K_form__kdefval_t(&v_1);
      if (new_kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&new_kv_typ_0);
      }
      if (v_0) {
         _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
      }
      if (kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kv_typ_0);
      }
      _fx_free_R17K_form__kdefval_t(&kv_0);
      _fx_free_N13K_form__dom_t(&d_0);
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM12update_kval_R9Ast__id_t3R9Ast__id_tR10Ast__loc_tRM9k_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_R17K_form__kdefval_t kv_0 = {0};
   _fx_N14K_form__ktyp_t kv_typ_0 = 0;
   _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_0 = 0;
   _fx_N14K_form__ktyp_t new_kv_typ_0 = 0;
   _fx_R17K_form__kdefval_t v_1 = {0};
   _fx_N15K_form__kinfo_t v_2 = {0};
   _fx_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t v_3 = 0;
   int fx_status = 0;
   bool t_0;
   if (n_0->m > 0) {
      t_0 = n_0->i > 0;
   }
   else {
      t_0 = false;
   }
   if (t_0) {
      FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(n_0, loc_0, &kv_0, 0), _fx_cleanup);
      FX_COPY_PTR(kv_0.kv_typ, &kv_typ_0);
      _fx_R9Ast__id_t kv_name_0 = kv_0.kv_name;
      FX_COPY_PTR(callb_0->kcb_atom, &v_0);
      _fx_R9Ast__id_t new_kv_name_0;
      if ((v_0 != 0) + 1 == 2) {
         _fx_N14K_form__atom_t v_4 = {0};
         _fx_N14K_form__atom_t v_5 = {0};
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_0 = &v_0->u.Some;
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&kv_name_0, &v_4);
         FX_CALL(f_0->fp(&v_4, loc_0, callb_0, &v_5, f_0->fcv), _fx_catch_1);
         if (v_5.tag == 1) {
            new_kv_name_0 = v_5.u.AtomId;
         }
         else {
            fx_exn_t v_6 = {0};
            fx_str_t slit_0 =
               FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_0, &v_6, 0), _fx_catch_0);
            FX_THROW(&v_6, false, _fx_catch_0);

         _fx_catch_0: ;
            fx_free_exn(&v_6);
         }
         FX_CHECK_EXN(_fx_catch_1);

      _fx_catch_1: ;
         _fx_free_N14K_form__atom_t(&v_5);
         _fx_free_N14K_form__atom_t(&v_4);
      }
      else {
         new_kv_name_0 = kv_name_0;
      }
      FX_CHECK_EXN(_fx_cleanup);
      FX_CALL(
         _fx_M6K_formFM17check_n_walk_ktypN14K_form__ktyp_t3N14K_form__ktyp_tR10Ast__loc_tRM9k_callb_t(kv_typ_0, loc_0, callb_0,
            &new_kv_typ_0, 0), _fx_cleanup);
      _fx_make_R17K_form__kdefval_t(&new_kv_name_0, &kv_0.kv_cname, new_kv_typ_0, &kv_0.kv_flags, &kv_0.kv_loc, &v_1);
      _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&v_1, &v_2);
      _fx_Ta2i v_7;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(&new_kv_name_0, &_fx_g10Ast__noloc, &v_7, 0), _fx_cleanup);
      int_ m_0 = v_7.t0;
      int_ j_0 = v_7.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_N15K_form__kinfo_t* v_8 =
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0);
      _fx_free_N15K_form__kinfo_t(v_8);
      _fx_copy_N15K_form__kinfo_t(&v_2, v_8);
      *fx_result = new_kv_name_0;
   }
   else {
      FX_COPY_PTR(callb_0->kcb_atom, &v_3);
      if ((v_3 != 0) + 1 == 2) {
         _fx_N14K_form__atom_t v_9 = {0};
         _fx_N14K_form__atom_t v_10 = {0};
         _fx_FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t* f_1 = &v_3->u.Some;
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_9);
         FX_CALL(f_1->fp(&v_9, loc_0, callb_0, &v_10, f_1->fcv), _fx_catch_3);
         if (v_10.tag == 1) {
            *fx_result = v_10.u.AtomId;
         }
         else {
            fx_exn_t v_11 = {0};
            fx_str_t slit_1 =
               FX_MAKE_STR("internal error: inside walk_id the callback returned a literal, not id, which is unexpected.");
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_11, 0), _fx_catch_2);
            FX_THROW(&v_11, false, _fx_catch_2);

         _fx_catch_2: ;
            fx_free_exn(&v_11);
         }
         FX_CHECK_EXN(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_N14K_form__atom_t(&v_10);
         _fx_free_N14K_form__atom_t(&v_9);
      }
      else {
         *fx_result = *n_0;
      }
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   _fx_free_R17K_form__kdefval_t(&kv_0);
   if (kv_typ_0) {
      _fx_free_N14K_form__ktyp_t(&kv_typ_0);
   }
   if (v_0) {
      _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_0);
   }
   if (new_kv_typ_0) {
      _fx_free_N14K_form__ktyp_t(&new_kv_typ_0);
   }
   _fx_free_R17K_form__kdefval_t(&v_1);
   _fx_free_N15K_form__kinfo_t(&v_2);
   if (v_3) {
      _fx_free_Nt6option1FPN14K_form__atom_t3N14K_form__atom_tR10Ast__loc_tR17K_form__k_callb_t(&v_3);
   }
   return fx_status;
}

static int _fx_M6K_formFM13process_elistLN14K_form__kexp_t3LN14K_form__kexp_tLN14K_form__kexp_tRM9k_callb_t(
   struct _fx_LN14K_form__kexp_t_data_t* elist_0,
   struct _fx_LN14K_form__kexp_t_data_t* result_0,
   struct _fx_R17K_form__k_callb_t* callb_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LN14K_form__kexp_t result_1 = 0;
   _fx_LN14K_form__kexp_t elist_1 = 0;
   _fx_LN14K_form__kexp_t result_2 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(elist_0, &elist_1);
   FX_COPY_PTR(result_0, &result_2);
   for (;;) {
      _fx_LN14K_form__kexp_t elist_2 = 0;
      _fx_LN14K_form__kexp_t result_3 = 0;
      FX_COPY_PTR(elist_1, &elist_2);
      FX_COPY_PTR(result_2, &result_3);
      if (elist_2 != 0) {
         _fx_N14K_form__kexp_t new_e_0 = 0;
         _fx_LN14K_form__kexp_t new_result_0 = 0;
         _fx_LN14K_form__kexp_t rest_0 = elist_2->tl;
         FX_CALL(_fx_M6K_formFM10walk_kexp_N14K_form__kexp_t2N14K_form__kexp_tRM9k_callb_t(elist_2->hd, callb_0, &new_e_0, 0),
            _fx_catch_6);
         int tag_0 = FX_REC_VARIANT_TAG(new_e_0);
         if (tag_0 == 1) {
            if (rest_0 != 0) {
               FX_COPY_PTR(result_3, &new_result_0);
            }
            else {
               FX_CALL(_fx_cons_LN14K_form__kexp_t(new_e_0, result_3, true, &new_result_0), _fx_catch_0);
            }

         _fx_catch_0: ;
         }
         else if (tag_0 == 10) {
            _fx_LN14K_form__kexp_t __fold_result___0 = 0;
            _fx_LN14K_form__kexp_t el_0 = 0;
            _fx_LN14K_form__kexp_t v_0 = 0;
            FX_COPY_PTR(new_e_0->u.KExpSeq.t0, &el_0);
            _fx_LN14K_form__kexp_t lst_0 = el_0;
            for (; lst_0; lst_0 = lst_0->tl) {
               _fx_LN14K_form__kexp_t r_0 = 0;
               _fx_N14K_form__kexp_t a_0 = lst_0->hd;
               FX_COPY_PTR(__fold_result___0, &r_0);
               FX_CALL(_fx_cons_LN14K_form__kexp_t(a_0, r_0, false, &r_0), _fx_catch_1);
               _fx_free_LN14K_form__kexp_t(&__fold_result___0);
               FX_COPY_PTR(r_0, &__fold_result___0);

            _fx_catch_1: ;
               if (r_0) {
                  _fx_free_LN14K_form__kexp_t(&r_0);
               }
               FX_CHECK_EXN(_fx_catch_4);
            }
            FX_COPY_PTR(__fold_result___0, &v_0);
            if (v_0 == 0) {
               FX_COPY_PTR(result_3, &new_result_0);
            }
            else if (result_3 == 0) {
               FX_COPY_PTR(v_0, &new_result_0);
            }
            else {
               _fx_LN14K_form__kexp_t v_1 = 0;
               _fx_LN14K_form__kexp_t lstend_0 = 0;
               _fx_LN14K_form__kexp_t lst_1 = v_0;
               for (; lst_1; lst_1 = lst_1->tl) {
                  _fx_N14K_form__kexp_t x_0 = lst_1->hd;
                  _fx_LN14K_form__kexp_t node_0 = 0;
                  FX_CALL(_fx_cons_LN14K_form__kexp_t(x_0, 0, false, &node_0), _fx_catch_2);
                  FX_LIST_APPEND(v_1, lstend_0, node_0);

               _fx_catch_2: ;
                  FX_CHECK_EXN(_fx_catch_3);
               }
               _fx_M6K_formFM5link2LN14K_form__kexp_t2LN14K_form__kexp_tLN14K_form__kexp_t(v_1, result_3, &new_result_0, 0);

            _fx_catch_3: ;
               if (v_1) {
                  _fx_free_LN14K_form__kexp_t(&v_1);
               }
            }
            FX_CHECK_EXN(_fx_catch_4);

         _fx_catch_4: ;
            if (v_0) {
               _fx_free_LN14K_form__kexp_t(&v_0);
            }
            if (el_0) {
               _fx_free_LN14K_form__kexp_t(&el_0);
            }
            if (__fold_result___0) {
               _fx_free_LN14K_form__kexp_t(&__fold_result___0);
            }
         }
         else {
            FX_CALL(_fx_cons_LN14K_form__kexp_t(new_e_0, result_3, true, &new_result_0), _fx_catch_5);  _fx_catch_5: ;
         }
         FX_CHECK_EXN(_fx_catch_6);
         _fx_free_LN14K_form__kexp_t(&elist_1);
         FX_COPY_PTR(rest_0, &elist_1);
         _fx_free_LN14K_form__kexp_t(&result_2);
         FX_COPY_PTR(new_result_0, &result_2);

      _fx_catch_6: ;
         if (new_result_0) {
            _fx_free_LN14K_form__kexp_t(&new_result_0);
         }
         if (new_e_0) {
            _fx_free_N14K_form__kexp_t(&new_e_0);
         }
      }
      else {
         _fx_LN14K_form__kexp_t __fold_result___1 = 0;
         _fx_LN14K_form__kexp_t result_4 = 0;
         _fx_LN14K_form__kexp_t lst_2 = result_3;
         for (; lst_2; lst_2 = lst_2->tl) {
            _fx_LN14K_form__kexp_t r_1 = 0;
            _fx_N14K_form__kexp_t a_1 = lst_2->hd;
            FX_COPY_PTR(__fold_result___1, &r_1);
            FX_CALL(_fx_cons_LN14K_form__kexp_t(a_1, r_1, false, &r_1), _fx_catch_7);
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
            FX_COPY_PTR(r_1, &__fold_result___1);

         _fx_catch_7: ;
            if (r_1) {
               _fx_free_LN14K_form__kexp_t(&r_1);
            }
            FX_CHECK_EXN(_fx_catch_8);
         }
         FX_COPY_PTR(__fold_result___1, &result_4);
         _fx_free_LN14K_form__kexp_t(&result_1);
         FX_COPY_PTR(result_4, &result_1);
         FX_BREAK(_fx_catch_8);

      _fx_catch_8: ;
         if (result_4) {
            _fx_free_LN14K_form__kexp_t(&result_4);
         }
         if (__fold_result___1) {
            _fx_free_LN14K_form__kexp_t(&__fold_result___1);
         }
      }
      FX_CHECK_EXN(_fx_catch_9);

   _fx_catch_9: ;
      if (result_3) {
         _fx_free_LN14K_form__kexp_t(&result_3);
      }
      if (elist_2) {
         _fx_free_LN14K_form__kexp_t(&elist_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_1, fx_result);

_fx_cleanup: ;
   if (result_1) {
      _fx_free_LN14K_form__kexp_t(&result_1);
   }
   if (elist_1) {
      _fx_free_LN14K_form__kexp_t(&elist_1);
   }
   if (result_2) {
      _fx_free_LN14K_form__kexp_t(&result_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_COPY_PTR(callb_0->kcb_fold_ktyp, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(t_0, loc_0, callb_0, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, loc_0, callb_0, 0), _fx_catch_1);

   _fx_catch_1: ;
   }

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM17check_n_fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_fold_kexp, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(e_0, callb_0, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      FX_CALL(_fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_0, callb_0, 0), _fx_catch_1);  _fx_catch_1: ;
   }
   if (v_0) {
      _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM17check_n_fold_atomv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(a_0, loc_0, callb_0, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      if (a_0->tag == 2) {
         _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
         if (v_1->tag == 8) {
            FX_CALL(
               _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_1->u.KLitNil, loc_0,
                  callb_0, 0), _fx_catch_1);

         _fx_catch_1: ;
            goto _fx_endmatch_0;
         }
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
   }
   if (v_0) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM16check_n_fold_domv3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = d_0->tag;
   if (tag_0 == 1) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
      _fx_N14K_form__atom_t* a_0 = &d_0->u.DomainElem;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
      if ((v_0 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
         FX_CALL(f_0->fp(a_0, loc_0, callb_0, f_0->fcv), _fx_catch_0);

      _fx_catch_0: ;
      }
      else {
         if (a_0->tag == 2) {
            _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
            if (v_1->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_1->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_1);

            _fx_catch_1: ;
               goto _fx_endmatch_0;
            }
         }

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_2);

      _fx_catch_2: ;
      }
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      if (v_0) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
      }
   }
   else if (tag_0 == 2) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
      _fx_N14K_form__atom_t* a_1 = &d_0->u.DomainFast;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_2);
      if ((v_2 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_1 = &v_2->u.Some;
         FX_CALL(f_1->fp(a_1, loc_0, callb_0, f_1->fcv), _fx_catch_4);

      _fx_catch_4: ;
      }
      else {
         if (a_1->tag == 2) {
            _fx_N14K_form__klit_t* v_3 = &a_1->u.AtomLit;
            if (v_3->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_3->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_5);

            _fx_catch_5: ;
               goto _fx_endmatch_1;
            }
         }

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_6);

      _fx_catch_6: ;
      }
      FX_CHECK_EXN(_fx_catch_7);

   _fx_catch_7: ;
      if (v_2) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
      }
   }
   else if (tag_0 == 3) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_4 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_5 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_6 = 0;
      _fx_Ta3N14K_form__atom_t* vcase_0 = &d_0->u.DomainRange;
      _fx_N14K_form__atom_t* c_0 = &vcase_0->t2;
      _fx_N14K_form__atom_t* b_0 = &vcase_0->t1;
      _fx_N14K_form__atom_t* a_2 = &vcase_0->t0;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_4);
      if ((v_4 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_2 = &v_4->u.Some;
         FX_CALL(f_2->fp(a_2, loc_0, callb_0, f_2->fcv), _fx_catch_8);

      _fx_catch_8: ;
      }
      else {
         if (a_2->tag == 2) {
            _fx_N14K_form__klit_t* v_7 = &a_2->u.AtomLit;
            if (v_7->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_7->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_9);

            _fx_catch_9: ;
               goto _fx_endmatch_2;
            }
         }

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_10);

      _fx_catch_10: ;
      }
      FX_CHECK_EXN(_fx_catch_17);
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_5);
      if ((v_5 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_3 = &v_5->u.Some;
         FX_CALL(f_3->fp(b_0, loc_0, callb_0, f_3->fcv), _fx_catch_11);

      _fx_catch_11: ;
      }
      else {
         if (b_0->tag == 2) {
            _fx_N14K_form__klit_t* v_8 = &b_0->u.AtomLit;
            if (v_8->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_8->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_12);

            _fx_catch_12: ;
               goto _fx_endmatch_3;
            }
         }

      _fx_endmatch_3: ;
         FX_CHECK_EXN(_fx_catch_13);

      _fx_catch_13: ;
      }
      FX_CHECK_EXN(_fx_catch_17);
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_6);
      if ((v_6 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_4 = &v_6->u.Some;
         FX_CALL(f_4->fp(c_0, loc_0, callb_0, f_4->fcv), _fx_catch_14);

      _fx_catch_14: ;
      }
      else {
         if (c_0->tag == 2) {
            _fx_N14K_form__klit_t* v_9 = &c_0->u.AtomLit;
            if (v_9->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_9->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_15);

            _fx_catch_15: ;
               goto _fx_endmatch_4;
            }
         }

      _fx_endmatch_4: ;
         FX_CHECK_EXN(_fx_catch_16);

      _fx_catch_16: ;
      }
      FX_CHECK_EXN(_fx_catch_17);

   _fx_catch_17: ;
      if (v_6) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_6);
      }
      if (v_5) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_5);
      }
      if (v_4) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_4);
      }
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(t_0);
   bool res_0;
   if (tag_0 == 1) {
      res_0 = true;
   }
   else if (tag_0 == 2) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else if (tag_0 == 6) {
      res_0 = true;
   }
   else if (tag_0 == 5) {
      res_0 = true;
   }
   else if (tag_0 == 7) {
      res_0 = true;
   }
   else if (tag_0 == 8) {
      res_0 = true;
   }
   else if (tag_0 == 9) {
      res_0 = true;
   }
   else if (tag_0 == 10) {
      res_0 = true;
   }
   else if (tag_0 == 11) {
      res_0 = true;
   }
   else if (tag_0 == 21) {
      res_0 = true;
   }
   else if (tag_0 == 22) {
      res_0 = true;
   }
   else if (tag_0 == 23) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      goto _fx_endmatch_3;
   }
   if (tag_0 == 12) {
      FX_CALL(
         _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(t_0->u.KTypRawPointer, callb_0, loc_0, 0),
         _fx_catch_0);

   _fx_catch_0: ;
      goto _fx_endmatch_3;
   }
   if (tag_0 == 13) {
      _fx_LN14K_form__ktyp_t args_0 = 0;
      _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* vcase_0 = &t_0->u.KTypFun;
      FX_COPY_PTR(vcase_0->t0, &args_0);
      _fx_LN14K_form__ktyp_t lst_0 = args_0;
      for (; lst_0; lst_0 = lst_0->tl) {
         _fx_N14K_form__ktyp_t x_0 = lst_0->hd;
         FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(x_0, callb_0, loc_0, 0),
            _fx_catch_1);

      _fx_catch_1: ;
         FX_CHECK_EXN(_fx_catch_2);
      }
      FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(vcase_0->t1, callb_0, loc_0, 0),
         _fx_catch_2);

   _fx_catch_2: ;
      if (args_0) {
         _fx_free_LN14K_form__ktyp_t(&args_0);
      }
      goto _fx_endmatch_3;
   }
   if (tag_0 == 14) {
      _fx_LN14K_form__ktyp_t elems_0 = 0;
      FX_COPY_PTR(t_0->u.KTypTuple, &elems_0);
      _fx_LN14K_form__ktyp_t lst_1 = elems_0;
      for (; lst_1; lst_1 = lst_1->tl) {
         _fx_N14K_form__ktyp_t x_1 = lst_1->hd;
         FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(x_1, callb_0, loc_0, 0),
            _fx_catch_3);

      _fx_catch_3: ;
         FX_CHECK_EXN(_fx_catch_4);
      }

   _fx_catch_4: ;
      if (elems_0) {
         _fx_free_LN14K_form__ktyp_t(&elems_0);
      }
      goto _fx_endmatch_3;
   }
   if (tag_0 == 15) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t relems_0 = 0;
      _fx_T2R9Ast__id_tLT2R9Ast__id_tN14K_form__ktyp_t* vcase_1 = &t_0->u.KTypRecord;
      _fx_R9Ast__id_t* rn_0 = &vcase_1->t0;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
      if ((v_0 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
         bool res_1;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(rn_0, &_fx_g9Ast__noid, &res_1, 0), _fx_catch_8);
         if (!res_1) {
            _fx_N14K_form__atom_t v_1 = {0};
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(rn_0, &v_1);
            FX_CALL(f_0->fp(&v_1, loc_0, callb_0, f_0->fcv), _fx_catch_5);

         _fx_catch_5: ;
            _fx_free_N14K_form__atom_t(&v_1);
            goto _fx_endmatch_0;
         }
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_8);
      FX_COPY_PTR(vcase_1->t1, &relems_0);
      _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_2 = relems_0;
      for (; lst_2; lst_2 = lst_2->tl) {
         _fx_N14K_form__ktyp_t ti_0 = 0;
         _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
         _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_2->hd;
         _fx_R9Ast__id_t ni_0 = __pat___0->t0;
         FX_COPY_PTR(__pat___0->t1, &ti_0);
         FX_COPY_PTR(callb_0->kcb_fold_atom, &v_2);
         if ((v_2 != 0) + 1 == 2) {
            _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_1 = &v_2->u.Some;
            bool res_2;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&ni_0, &_fx_g9Ast__noid, &res_2, 0), _fx_catch_7);
            if (!res_2) {
               _fx_N14K_form__atom_t v_3 = {0};
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&ni_0, &v_3);
               FX_CALL(f_1->fp(&v_3, loc_0, callb_0, f_1->fcv), _fx_catch_6);

            _fx_catch_6: ;
               _fx_free_N14K_form__atom_t(&v_3);
               goto _fx_endmatch_1;
            }
         }

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_7);
         FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(ti_0, callb_0, loc_0, 0),
            _fx_catch_7);

      _fx_catch_7: ;
         if (v_2) {
            _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
         }
         if (ti_0) {
            _fx_free_N14K_form__ktyp_t(&ti_0);
         }
         FX_CHECK_EXN(_fx_catch_8);
      }

   _fx_catch_8: ;
      if (relems_0) {
         _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&relems_0);
      }
      if (v_0) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
      }
      goto _fx_endmatch_3;
   }
   if (tag_0 == 16) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_4 = 0;
      _fx_R9Ast__id_t* n_0 = &t_0->u.KTypName;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_4);
      if ((v_4 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_2 = &v_4->u.Some;
         bool res_3;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_3, 0), _fx_catch_10);
         if (!res_3) {
            _fx_N14K_form__atom_t v_5 = {0};
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_5);
            FX_CALL(f_2->fp(&v_5, loc_0, callb_0, f_2->fcv), _fx_catch_9);

         _fx_catch_9: ;
            _fx_free_N14K_form__atom_t(&v_5);
            goto _fx_endmatch_2;
         }
      }

   _fx_endmatch_2: ;
      FX_CHECK_EXN(_fx_catch_10);

   _fx_catch_10: ;
      if (v_4) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_4);
      }
      goto _fx_endmatch_3;
   }
   if (tag_0 == 17) {
      FX_CALL(
         _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(t_0->u.KTypArray.t1, callb_0, loc_0, 0),
         _fx_catch_11);

   _fx_catch_11: ;
      goto _fx_endmatch_3;
   }
   if (tag_0 == 19) {
      FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(t_0->u.KTypList, callb_0, loc_0, 0),
         _fx_catch_12);

   _fx_catch_12: ;
      goto _fx_endmatch_3;
   }
   if (tag_0 == 18) {
      FX_CALL(
         _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(t_0->u.KTypVector, callb_0, loc_0, 0),
         _fx_catch_13);

   _fx_catch_13: ;
      goto _fx_endmatch_3;
   }
   if (tag_0 == 20) {
      FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(t_0->u.KTypRef, callb_0, loc_0, 0),
         _fx_catch_14);

   _fx_catch_14: ;
      goto _fx_endmatch_3;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_3: ;

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tRM14k_fold_callb_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   struct _fx_R10Ast__loc_t* loc_0,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(_fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, loc_0, callb_0, 0),
      _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_FPv1N14K_form__kexp_t fold_kexp__0 = {0};
   int fx_status = 0;
   _fx_M6K_formFM7make_fpFPv1N14K_form__kexp_t1RM14k_fold_callb_t(callb_0, &fold_kexp__0);
   int tag_0 = FX_REC_VARIANT_TAG(e_0);
   if (tag_0 != 1) {
      if (tag_0 != 2) {
         if (tag_0 != 3) {
            if (tag_0 == 4) {
               _fx_T2Nt6option1N14K_form__atom_tR10Ast__loc_t* vcase_0 = &e_0->u.KExpReturn;
               _fx_Nt6option1N14K_form__atom_t* a_opt_0 = &vcase_0->t0;
               if (a_opt_0->tag == 2) {
                  FX_CALL(
                     _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&a_opt_0->u.Some,
                        &vcase_0->t1, callb_0, 0), _fx_catch_0);

               _fx_catch_0: ;
               }
               FX_CHECK_EXN(_fx_catch_1);

            _fx_catch_1: ;
            }
            else if (tag_0 == 5) {
               _fx_T2N14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_1 = &e_0->u.KExpAtom;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_0 = &vcase_1->t1;
               _fx_R10Ast__loc_t* loc_0 = &v_0->t1;
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_1->t0, loc_0, callb_0, 0),
                  _fx_catch_2);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_0->t0, loc_0, callb_0, 0),
                  _fx_catch_2);

            _fx_catch_2: ;
            }
            else if (tag_0 == 6) {
               _fx_T4N13Ast__binary_tN14K_form__atom_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_2 =
                  &e_0->u.KExpBinary;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_1 = &vcase_2->t3;
               _fx_R10Ast__loc_t* loc_1 = &v_1->t1;
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_2->t1, loc_1, callb_0, 0),
                  _fx_catch_3);
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_2->t2, loc_1, callb_0, 0),
                  _fx_catch_3);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_1->t0, loc_1, callb_0, 0),
                  _fx_catch_3);

            _fx_catch_3: ;
            }
            else if (tag_0 == 7) {
               _fx_T3N12Ast__unary_tN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_3 = &e_0->u.KExpUnary;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_2 = &vcase_3->t2;
               _fx_R10Ast__loc_t* loc_2 = &v_2->t1;
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_3->t1, loc_2, callb_0, 0),
                  _fx_catch_4);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_2->t0, loc_2, callb_0, 0),
                  _fx_catch_4);

            _fx_catch_4: ;
            }
            else if (tag_0 == 8) {
               _fx_T3N13Ast__intrin_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_4 = &e_0->u.KExpIntrin;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_3 = &vcase_4->t2;
               _fx_R10Ast__loc_t* loc_3 = &v_3->t1;
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_4->t1, loc_3, callb_0, 0),
                  _fx_catch_5);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_3->t0, loc_3, callb_0, 0),
                  _fx_catch_5);

            _fx_catch_5: ;
            }
            else if (tag_0 == 11) {
               _fx_T4N14K_form__kexp_tN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_5 =
                  &e_0->u.KExpIf;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_4 = &vcase_5->t3;
               FX_CALL(fold_kexp__0.fp(vcase_5->t0, fold_kexp__0.fcv), _fx_catch_6);
               FX_CALL(fold_kexp__0.fp(vcase_5->t1, fold_kexp__0.fcv), _fx_catch_6);
               FX_CALL(fold_kexp__0.fp(vcase_5->t2, fold_kexp__0.fcv), _fx_catch_6);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_4->t0, &v_4->t1, callb_0, 0),
                  _fx_catch_6);

            _fx_catch_6: ;
            }
            else if (tag_0 == 10) {
               _fx_T2LN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_6 = &e_0->u.KExpSeq;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_5 = &vcase_6->t1;
               FX_CALL(_fx_M6K_formFM3appv2LN14K_form__kexp_tFPv1N14K_form__kexp_t(vcase_6->t0, &fold_kexp__0, 0), _fx_catch_7);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_5->t0, &v_5->t1, callb_0, 0),
                  _fx_catch_7);

            _fx_catch_7: ;
            }
            else if (tag_0 == 9) {
               FX_CALL(fold_kexp__0.fp(e_0->u.KExpSync.t1, fold_kexp__0.fcv), _fx_catch_8);  _fx_catch_8: ;
            }
            else if (tag_0 == 14) {
               _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_7 = &e_0->u.KExpMkTuple;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_6 = &vcase_7->t1;
               _fx_R10Ast__loc_t* loc_4 = &v_6->t1;
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_7->t0, loc_4, callb_0, 0),
                  _fx_catch_9);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_6->t0, loc_4, callb_0, 0),
                  _fx_catch_9);

            _fx_catch_9: ;
            }
            else if (tag_0 == 15) {
               _fx_T2LN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_8 = &e_0->u.KExpMkRecord;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_7 = &vcase_8->t1;
               _fx_R10Ast__loc_t* loc_5 = &v_7->t1;
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_8->t0, loc_5, callb_0, 0),
                  _fx_catch_10);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_7->t0, loc_5, callb_0, 0),
                  _fx_catch_10);

            _fx_catch_10: ;
            }
            else if (tag_0 == 16) {
               _fx_T4R9Ast__id_tR9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_9 = &e_0->u.KExpMkClosure;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_8 = &vcase_9->t3;
               _fx_R10Ast__loc_t* loc_6 = &v_8->t1;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_9->t0, loc_6, callb_0, 0),
                  _fx_catch_11);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_9->t1, loc_6, callb_0, 0),
                  _fx_catch_11);
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_9->t2, loc_6, callb_0, 0),
                  _fx_catch_11);
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_8->t0, loc_6, callb_0, 0),
                  _fx_catch_11);

            _fx_catch_11: ;
            }
            else if (tag_0 == 17) {
               _fx_LLT2BN14K_form__atom_t elems_0 = 0;
               _fx_T3BLLT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_10 = &e_0->u.KExpMkArray;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_9 = &vcase_10->t2;
               _fx_R10Ast__loc_t* loc_7 = &v_9->t1;
               if (!vcase_10->t0) {
                  FX_COPY_PTR(vcase_10->t1, &elems_0);
                  _fx_LLT2BN14K_form__atom_t lst_0 = elems_0;
                  for (; lst_0; lst_0 = lst_0->tl) {
                     _fx_LT2BN14K_form__atom_t row_0 = lst_0->hd;
                     _fx_LT2BN14K_form__atom_t lst_1 = row_0;
                     for (; lst_1; lst_1 = lst_1->tl) {
                        _fx_N14K_form__atom_t a_0 = {0};
                        _fx_T2BN14K_form__atom_t* __pat___0 = &lst_1->hd;
                        _fx_copy_N14K_form__atom_t(&__pat___0->t1, &a_0);
                        FX_CALL(
                           _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&a_0, loc_7, callb_0,
                              0), _fx_catch_12);

                     _fx_catch_12: ;
                        _fx_free_N14K_form__atom_t(&a_0);
                        FX_CHECK_EXN(_fx_catch_13);
                     }

                  _fx_catch_13: ;
                     FX_CHECK_EXN(_fx_catch_14);
                  }
               }
               FX_CALL(_fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_9->t0, loc_7, callb_0, 0),
                  _fx_catch_14);

            _fx_catch_14: ;
               if (elems_0) {
                  _fx_free_LLT2BN14K_form__atom_t(&elems_0);
               }
            }
            else if (tag_0 == 18) {
               _fx_LT2BN14K_form__atom_t elems_1 = 0;
               _fx_T2LT2BN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_11 = &e_0->u.KExpMkVector;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_10 = &vcase_11->t1;
               _fx_R10Ast__loc_t* loc_8 = &v_10->t1;
               FX_COPY_PTR(vcase_11->t0, &elems_1);
               _fx_LT2BN14K_form__atom_t lst_2 = elems_1;
               for (; lst_2; lst_2 = lst_2->tl) {
                  _fx_N14K_form__atom_t a_1 = {0};
                  _fx_T2BN14K_form__atom_t* __pat___1 = &lst_2->hd;
                  _fx_copy_N14K_form__atom_t(&__pat___1->t1, &a_1);
                  FX_CALL(_fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&a_1, loc_8, callb_0, 0),
                     _fx_catch_15);

               _fx_catch_15: ;
                  _fx_free_N14K_form__atom_t(&a_1);
                  FX_CHECK_EXN(_fx_catch_16);
               }
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_10->t0, loc_8, callb_0, 0),
                  _fx_catch_16);

            _fx_catch_16: ;
               if (elems_1) {
                  _fx_free_LT2BN14K_form__atom_t(&elems_1);
               }
            }
            else if (tag_0 == 12) {
               _fx_T3R9Ast__id_tLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_12 = &e_0->u.KExpCall;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_11 = &vcase_12->t2;
               _fx_R10Ast__loc_t* loc_9 = &v_11->t1;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_12->t0, loc_9, callb_0, 0),
                  _fx_catch_17);
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_12->t1, loc_9, callb_0, 0),
                  _fx_catch_17);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_11->t0, loc_9, callb_0, 0),
                  _fx_catch_17);

            _fx_catch_17: ;
            }
            else if (tag_0 == 13) {
               _fx_T4R9Ast__id_tiLN14K_form__atom_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_13 = &e_0->u.KExpICall;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_12 = &vcase_13->t3;
               _fx_R10Ast__loc_t* loc_10 = &v_12->t1;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_13->t0, loc_10, callb_0, 0),
                  _fx_catch_18);
               FX_CALL(
                  _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_13->t2, loc_10, callb_0, 0),
                  _fx_catch_18);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_12->t0, loc_10, callb_0, 0),
                  _fx_catch_18);

            _fx_catch_18: ;
            }
            else if (tag_0 == 19) {
               _fx_LN13K_form__dom_t idxs_0 = 0;
               _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t*
                  vcase_14 = &e_0->u.KExpAt;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_13 = &vcase_14->t4;
               _fx_R10Ast__loc_t* loc_11 = &v_13->t1;
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_14->t0, loc_11, callb_0,
                     0), _fx_catch_20);
               FX_COPY_PTR(vcase_14->t3, &idxs_0);
               _fx_LN13K_form__dom_t lst_3 = idxs_0;
               for (; lst_3; lst_3 = lst_3->tl) {
                  _fx_N13K_form__dom_t* idx_0 = &lst_3->hd;
                  FX_CALL(_fx_M6K_formFM9fold_dom_v3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(idx_0, loc_11, callb_0, 0),
                     _fx_catch_19);

               _fx_catch_19: ;
                  FX_CHECK_EXN(_fx_catch_20);
               }
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_13->t0, loc_11, callb_0, 0),
                  _fx_catch_20);

            _fx_catch_20: ;
               if (idxs_0) {
                  _fx_free_LN13K_form__dom_t(&idxs_0);
               }
            }
            else if (tag_0 == 21) {
               _fx_T3R9Ast__id_tN14K_form__atom_tR10Ast__loc_t* vcase_15 = &e_0->u.KExpAssign;
               _fx_R10Ast__loc_t* loc_12 = &vcase_15->t2;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_15->t0, loc_12, callb_0, 0),
                  _fx_catch_21);
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_15->t1, loc_12, callb_0,
                     0), _fx_catch_21);

            _fx_catch_21: ;
            }
            else if (tag_0 == 20) {
               _fx_T3R9Ast__id_tiT2N14K_form__ktyp_tR10Ast__loc_t* vcase_16 = &e_0->u.KExpMem;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_14 = &vcase_16->t2;
               _fx_R10Ast__loc_t* loc_13 = &v_14->t1;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_16->t0, loc_13, callb_0, 0),
                  _fx_catch_22);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_14->t0, loc_13, callb_0, 0),
                  _fx_catch_22);

            _fx_catch_22: ;
            }
            else if (tag_0 == 24) {
               _fx_T3R9Ast__id_tBR10Ast__loc_t* vcase_17 = &e_0->u.KExpThrow;
               FX_CALL(
                  _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_17->t0, &vcase_17->t2, callb_0, 0),
                  _fx_catch_23);

            _fx_catch_23: ;
            }
            else if (tag_0 == 28) {
               _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* vcase_18 = &e_0->u.KExpWhile;
               FX_CALL(fold_kexp__0.fp(vcase_18->t0, fold_kexp__0.fcv), _fx_catch_24);
               FX_CALL(fold_kexp__0.fp(vcase_18->t1, fold_kexp__0.fcv), _fx_catch_24);

            _fx_catch_24: ;
            }
            else if (tag_0 == 29) {
               _fx_T3N14K_form__kexp_tN14K_form__kexp_tR10Ast__loc_t* vcase_19 = &e_0->u.KExpDoWhile;
               FX_CALL(fold_kexp__0.fp(vcase_19->t0, fold_kexp__0.fcv), _fx_catch_25);
               FX_CALL(fold_kexp__0.fp(vcase_19->t1, fold_kexp__0.fcv), _fx_catch_25);

            _fx_catch_25: ;
            }
            else if (tag_0 == 27) {
               _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* vcase_20 =
                  &e_0->u.KExpFor;
               _fx_R10Ast__loc_t* loc_14 = &vcase_20->t4;
               FX_CALL(
                  _fx_M6K_formFM11fold_idoml_v3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(vcase_20->t0,
                     loc_14, callb_0, 0), _fx_catch_26);
               FX_CALL(
                  _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(vcase_20->t1, loc_14, true,
                     callb_0, 0), _fx_catch_26);
               FX_CALL(fold_kexp__0.fp(vcase_20->t2, fold_kexp__0.fcv), _fx_catch_26);

            _fx_catch_26: ;
            }
            else if (tag_0 == 26) {
               _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t e_idoml_l_0 = 0;
               _fx_T4LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tT2N14K_form__ktyp_tR10Ast__loc_t*
                  vcase_21 = &e_0->u.KExpMap;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_15 = &vcase_21->t3;
               _fx_R10Ast__loc_t* loc_15 = &v_15->t1;
               FX_COPY_PTR(vcase_21->t0, &e_idoml_l_0);
               _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t lst_4 = e_idoml_l_0;
               for (; lst_4; lst_4 = lst_4->tl) {
                  _fx_N14K_form__kexp_t e_1 = 0;
                  _fx_LT2R9Ast__id_tN13K_form__dom_t idoml_0 = 0;
                  _fx_LR9Ast__id_t at_ids_0 = 0;
                  _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* __pat___2 = &lst_4->hd;
                  FX_COPY_PTR(__pat___2->t0, &e_1);
                  FX_COPY_PTR(__pat___2->t1, &idoml_0);
                  FX_COPY_PTR(__pat___2->t2, &at_ids_0);
                  FX_CALL(fold_kexp__0.fp(e_1, fold_kexp__0.fcv), _fx_catch_27);
                  FX_CALL(
                     _fx_M6K_formFM11fold_idoml_v3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(idoml_0, loc_15,
                        callb_0, 0), _fx_catch_27);
                  FX_CALL(
                     _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(at_ids_0, loc_15, true, callb_0,
                        0), _fx_catch_27);

               _fx_catch_27: ;
                  FX_FREE_LIST_SIMPLE(&at_ids_0);
                  if (idoml_0) {
                     _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&idoml_0);
                  }
                  if (e_1) {
                     _fx_free_N14K_form__kexp_t(&e_1);
                  }
                  FX_CHECK_EXN(_fx_catch_28);
               }
               FX_CALL(fold_kexp__0.fp(vcase_21->t1, fold_kexp__0.fcv), _fx_catch_28);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_15->t0, loc_15, callb_0, 0),
                  _fx_catch_28);

            _fx_catch_28: ;
               if (e_idoml_l_0) {
                  _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&e_idoml_l_0);
               }
            }
            else if (tag_0 == 22) {
               _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t cases_0 = 0;
               _fx_T2LT2LN14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_22 = &e_0->u.KExpMatch;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_16 = &vcase_22->t1;
               FX_COPY_PTR(vcase_22->t0, &cases_0);
               _fx_LT2LN14K_form__kexp_tN14K_form__kexp_t lst_5 = cases_0;
               for (; lst_5; lst_5 = lst_5->tl) {
                  _fx_LN14K_form__kexp_t checks_i_0 = 0;
                  _fx_N14K_form__kexp_t ei_0 = 0;
                  _fx_T2LN14K_form__kexp_tN14K_form__kexp_t* __pat___3 = &lst_5->hd;
                  FX_COPY_PTR(__pat___3->t0, &checks_i_0);
                  FX_COPY_PTR(__pat___3->t1, &ei_0);
                  _fx_LN14K_form__kexp_t lst_6 = checks_i_0;
                  for (; lst_6; lst_6 = lst_6->tl) {
                     _fx_N14K_form__kexp_t cij_0 = lst_6->hd;
                     FX_CALL(fold_kexp__0.fp(cij_0, fold_kexp__0.fcv), _fx_catch_29);

                  _fx_catch_29: ;
                     FX_CHECK_EXN(_fx_catch_30);
                  }
                  FX_CALL(fold_kexp__0.fp(ei_0, fold_kexp__0.fcv), _fx_catch_30);

               _fx_catch_30: ;
                  if (ei_0) {
                     _fx_free_N14K_form__kexp_t(&ei_0);
                  }
                  if (checks_i_0) {
                     _fx_free_LN14K_form__kexp_t(&checks_i_0);
                  }
                  FX_CHECK_EXN(_fx_catch_31);
               }
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_16->t0, &v_16->t1, callb_0, 0),
                  _fx_catch_31);

            _fx_catch_31: ;
               if (cases_0) {
                  _fx_free_LT2LN14K_form__kexp_tN14K_form__kexp_t(&cases_0);
               }
            }
            else if (tag_0 == 23) {
               _fx_T3N14K_form__kexp_tN14K_form__kexp_tT2N14K_form__ktyp_tR10Ast__loc_t* vcase_23 = &e_0->u.KExpTryCatch;
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_17 = &vcase_23->t2;
               FX_CALL(fold_kexp__0.fp(vcase_23->t0, fold_kexp__0.fcv), _fx_catch_32);
               FX_CALL(fold_kexp__0.fp(vcase_23->t1, fold_kexp__0.fcv), _fx_catch_32);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_17->t0, &v_17->t1, callb_0, 0),
                  _fx_catch_32);

            _fx_catch_32: ;
            }
            else if (tag_0 == 25) {
               _fx_T3N14K_form__atom_tN14K_form__ktyp_tR10Ast__loc_t* vcase_24 = &e_0->u.KExpCast;
               _fx_R10Ast__loc_t* loc_16 = &vcase_24->t2;
               FX_CALL(
                  _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_24->t0, loc_16, callb_0,
                     0), _fx_catch_33);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(vcase_24->t1, loc_16, callb_0,
                     0), _fx_catch_33);

            _fx_catch_33: ;
            }
            else if (tag_0 == 30) {
               _fx_T2N14K_form__ktyp_tR10Ast__loc_t* v_18 = &e_0->u.KExpCCode.t1;
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_18->t0, &v_18->t1, callb_0, 0),
                  _fx_catch_34);

            _fx_catch_34: ;
            }
            else if (tag_0 == 31) {
               _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* vcase_25 = &e_0->u.KDefVal;
               FX_CALL(
                  _fx_M6K_formFM10fold_kval_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&vcase_25->t0, &vcase_25->t2, callb_0,
                     0), _fx_catch_35);
               FX_CALL(fold_kexp__0.fp(vcase_25->t1, fold_kexp__0.fcv), _fx_catch_35);

            _fx_catch_35: ;
            }
            else if (tag_0 == 32) {
               _fx_N14K_form__kexp_t kf_body_0 = 0;
               _fx_N14K_form__ktyp_t kf_rt_0 = 0;
               _fx_LR9Ast__id_t kf_params_0 = 0;
               _fx_R17K_form__kdeffun_t* v_19 = &e_0->u.KDefFun->data;
               _fx_R10Ast__loc_t kf_loc_0 = v_19->kf_loc;
               _fx_R25K_form__kdefclosureinfo_t kf_closure_0 = v_19->kf_closure;
               FX_COPY_PTR(v_19->kf_body, &kf_body_0);
               FX_COPY_PTR(v_19->kf_rt, &kf_rt_0);
               FX_COPY_PTR(v_19->kf_params, &kf_params_0);
               _fx_R9Ast__id_t kf_name_0 = v_19->kf_name;
               _fx_R9Ast__id_t kci_wrap_f_0 = kf_closure_0.kci_wrap_f;
               _fx_R9Ast__id_t kci_make_fp_0 = kf_closure_0.kci_make_fp;
               _fx_R9Ast__id_t kci_fp_typ_0 = kf_closure_0.kci_fp_typ;
               _fx_R9Ast__id_t kci_fcv_t_0 = kf_closure_0.kci_fcv_t;
               _fx_R9Ast__id_t kci_arg_0 = kf_closure_0.kci_arg;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kf_name_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(kf_params_0, &kf_loc_0, true,
                     callb_0, 0), _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kf_rt_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM10fold_kval_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kci_arg_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kci_fcv_t_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kci_fp_typ_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kci_make_fp_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(
                  _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kci_wrap_f_0, &kf_loc_0, callb_0, 0),
                  _fx_catch_36);
               FX_CALL(fold_kexp__0.fp(kf_body_0, fold_kexp__0.fcv), _fx_catch_36);

            _fx_catch_36: ;
               FX_FREE_LIST_SIMPLE(&kf_params_0);
               if (kf_rt_0) {
                  _fx_free_N14K_form__ktyp_t(&kf_rt_0);
               }
               if (kf_body_0) {
                  _fx_free_N14K_form__kexp_t(&kf_body_0);
               }
            }
            else if (tag_0 == 33) {
               _fx_N14K_form__ktyp_t ke_typ_0 = 0;
               _fx_R17K_form__kdefexn_t* v_20 = &e_0->u.KDefExn->data;
               _fx_R10Ast__loc_t ke_loc_0 = v_20->ke_loc;
               _fx_R9Ast__id_t ke_make_0 = v_20->ke_make;
               _fx_R9Ast__id_t ke_tag_0 = v_20->ke_tag;
               FX_COPY_PTR(v_20->ke_typ, &ke_typ_0);
               _fx_R9Ast__id_t ke_name_0 = v_20->ke_name;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ke_name_0, &ke_loc_0, callb_0, 0),
                  _fx_catch_37);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(ke_typ_0, &ke_loc_0, callb_0, 0),
                  _fx_catch_37);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ke_tag_0, &ke_loc_0, callb_0, 0),
                  _fx_catch_37);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ke_make_0, &ke_loc_0, callb_0, 0),
                  _fx_catch_37);

            _fx_catch_37: ;
               if (ke_typ_0) {
                  _fx_free_N14K_form__ktyp_t(&ke_typ_0);
               }
            }
            else if (tag_0 == 34) {
               _fx_LT2R9Ast__id_tLR9Ast__id_t kvar_ifaces_0 = 0;
               _fx_LR9Ast__id_t kvar_ctors_0 = 0;
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
               _fx_R21K_form__kdefvariant_t* v_21 = &e_0->u.KDefVariant->data;
               _fx_R10Ast__loc_t kvar_loc_0 = v_21->kvar_loc;
               FX_COPY_PTR(v_21->kvar_ifaces, &kvar_ifaces_0);
               FX_COPY_PTR(v_21->kvar_ctors, &kvar_ctors_0);
               FX_COPY_PTR(v_21->kvar_cases, &kvar_cases_0);
               _fx_R9Ast__id_t kvar_name_0 = v_21->kvar_name;
               FX_CALL(
                  _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kvar_name_0, &kvar_loc_0, callb_0, 0),
                  _fx_catch_43);
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_7 = kvar_cases_0;
               for (; lst_7; lst_7 = lst_7->tl) {
                  _fx_N14K_form__ktyp_t t_0 = 0;
                  _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___4 = &lst_7->hd;
                  _fx_R9Ast__id_t n_0 = __pat___4->t0;
                  FX_COPY_PTR(__pat___4->t1, &t_0);
                  FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&n_0, &kvar_loc_0, callb_0, 0),
                     _fx_catch_38);
                  FX_CALL(
                     _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, &kvar_loc_0, callb_0, 0),
                     _fx_catch_38);

               _fx_catch_38: ;
                  if (t_0) {
                     _fx_free_N14K_form__ktyp_t(&t_0);
                  }
                  FX_CHECK_EXN(_fx_catch_43);
               }
               _fx_LR9Ast__id_t lst_8 = kvar_ctors_0;
               for (; lst_8; lst_8 = lst_8->tl) {
                  _fx_N15K_form__kinfo_t v_22 = {0};
                  _fx_R9Ast__id_t* c_0 = &lst_8->hd;
                  FX_CALL(_fx_M6K_formFM6kinfo_N15K_form__kinfo_t2R9Ast__id_tR10Ast__loc_t(c_0, &kvar_loc_0, &v_22, 0),
                     _fx_catch_41);
                  if (v_22.tag == 2) {
                     FX_CALL(
                        _fx_M6K_formFM10fold_kval_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(c_0, &kvar_loc_0, callb_0, 0),
                        _fx_catch_39);

                  _fx_catch_39: ;
                  }
                  else {
                     FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(c_0, &kvar_loc_0, callb_0, 0),
                        _fx_catch_40);

                  _fx_catch_40: ;
                  }
                  FX_CHECK_EXN(_fx_catch_41);

               _fx_catch_41: ;
                  _fx_free_N15K_form__kinfo_t(&v_22);
                  FX_CHECK_EXN(_fx_catch_43);
               }
               _fx_LT2R9Ast__id_tLR9Ast__id_t lst_9 = kvar_ifaces_0;
               for (; lst_9; lst_9 = lst_9->tl) {
                  _fx_LR9Ast__id_t meths_0 = 0;
                  _fx_T2R9Ast__id_tLR9Ast__id_t* __pat___5 = &lst_9->hd;
                  _fx_R9Ast__id_t iname_0 = __pat___5->t0;
                  FX_COPY_PTR(__pat___5->t1, &meths_0);
                  FX_CALL(
                     _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&iname_0, &kvar_loc_0, callb_0, 0),
                     _fx_catch_42);
                  FX_CALL(
                     _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(meths_0, &kvar_loc_0, false,
                        callb_0, 0), _fx_catch_42);

               _fx_catch_42: ;
                  FX_FREE_LIST_SIMPLE(&meths_0);
                  FX_CHECK_EXN(_fx_catch_43);
               }

            _fx_catch_43: ;
               if (kvar_cases_0) {
                  _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
               }
               FX_FREE_LIST_SIMPLE(&kvar_ctors_0);
               if (kvar_ifaces_0) {
                  _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&kvar_ifaces_0);
               }
            }
            else if (tag_0 == 36) {
               _fx_N14K_form__ktyp_t kt_typ_0 = 0;
               _fx_R17K_form__kdeftyp_t* v_23 = &e_0->u.KDefTyp->data;
               _fx_R10Ast__loc_t kt_loc_0 = v_23->kt_loc;
               FX_COPY_PTR(v_23->kt_typ, &kt_typ_0);
               _fx_R9Ast__id_t kt_name_0 = v_23->kt_name;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kt_name_0, &kt_loc_0, callb_0, 0),
                  _fx_catch_44);
               FX_CALL(
                  _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kt_typ_0, &kt_loc_0, callb_0, 0),
                  _fx_catch_44);

            _fx_catch_44: ;
               if (kt_typ_0) {
                  _fx_free_N14K_form__ktyp_t(&kt_typ_0);
               }
            }
            else if (tag_0 == 35) {
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t ki_all_methods_0 = 0;
               _fx_R23K_form__kdefinterface_t* v_24 = &e_0->u.KDefInterface->data;
               _fx_R10Ast__loc_t ki_loc_0 = v_24->ki_loc;
               FX_COPY_PTR(v_24->ki_all_methods, &ki_all_methods_0);
               _fx_R9Ast__id_t ki_id_0 = v_24->ki_id;
               _fx_R9Ast__id_t ki_base_0 = v_24->ki_base;
               _fx_R9Ast__id_t ki_name_0 = v_24->ki_name;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ki_name_0, &ki_loc_0, callb_0, 0),
                  _fx_catch_46);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ki_base_0, &ki_loc_0, callb_0, 0),
                  _fx_catch_46);
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&ki_id_0, &ki_loc_0, callb_0, 0),
                  _fx_catch_46);
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_10 = ki_all_methods_0;
               for (; lst_10; lst_10 = lst_10->tl) {
                  _fx_N14K_form__ktyp_t t_1 = 0;
                  _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___6 = &lst_10->hd;
                  _fx_R9Ast__id_t f_0 = __pat___6->t0;
                  FX_COPY_PTR(__pat___6->t1, &t_1);
                  FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&f_0, &ki_loc_0, callb_0, 0),
                     _fx_catch_45);
                  FX_CALL(
                     _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_1, &ki_loc_0, callb_0, 0),
                     _fx_catch_45);

               _fx_catch_45: ;
                  if (t_1) {
                     _fx_free_N14K_form__ktyp_t(&t_1);
                  }
                  FX_CHECK_EXN(_fx_catch_46);
               }

            _fx_catch_46: ;
               if (ki_all_methods_0) {
                  _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&ki_all_methods_0);
               }
            }
            else if (tag_0 == 37) {
               _fx_LR9Ast__id_t kcv_orig_freevars_0 = 0;
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t kcv_freevars_0 = 0;
               _fx_R25K_form__kdefclosurevars_t* v_25 = &e_0->u.KDefClosureVars->data;
               _fx_R10Ast__loc_t kcv_loc_0 = v_25->kcv_loc;
               FX_COPY_PTR(v_25->kcv_orig_freevars, &kcv_orig_freevars_0);
               FX_COPY_PTR(v_25->kcv_freevars, &kcv_freevars_0);
               _fx_R9Ast__id_t kcv_name_0 = v_25->kcv_name;
               FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&kcv_name_0, &kcv_loc_0, callb_0, 0),
                  _fx_catch_48);
               _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_11 = kcv_freevars_0;
               for (; lst_11; lst_11 = lst_11->tl) {
                  _fx_N14K_form__ktyp_t t_2 = 0;
                  _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___7 = &lst_11->hd;
                  _fx_R9Ast__id_t n_1 = __pat___7->t0;
                  FX_COPY_PTR(__pat___7->t1, &t_2);
                  FX_CALL(_fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(&n_1, &kcv_loc_0, callb_0, 0),
                     _fx_catch_47);
                  FX_CALL(
                     _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_2, &kcv_loc_0, callb_0, 0),
                     _fx_catch_47);

               _fx_catch_47: ;
                  if (t_2) {
                     _fx_free_N14K_form__ktyp_t(&t_2);
                  }
                  FX_CHECK_EXN(_fx_catch_48);
               }
               FX_CALL(
                  _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(kcv_orig_freevars_0, &kcv_loc_0,
                     false, callb_0, 0), _fx_catch_48);

            _fx_catch_48: ;
               if (kcv_freevars_0) {
                  _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kcv_freevars_0);
               }
               FX_FREE_LIST_SIMPLE(&kcv_orig_freevars_0);
            }
            else {
               FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
            }
         }
      }
   }

_fx_cleanup: ;
   FX_FREE_FP(&fold_kexp__0);
   return fx_status;
}

static int _fx_M6K_formFM10fold_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
      FX_CALL(f_0->fp(a_0, loc_0, callb_0, f_0->fcv), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      if (a_0->tag == 2) {
         _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
         if (v_1->tag == 8) {
            FX_CALL(
               _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_1->u.KLitNil, loc_0,
                  callb_0, 0), _fx_catch_1);

         _fx_catch_1: ;
            goto _fx_endmatch_0;
         }
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_2);

   _fx_catch_2: ;
   }
   if (v_0) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
   }
   return fx_status;
}

static int _fx_M6K_formFM8fold_al_v3LN14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_LN14K_form__atom_t_data_t* al_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LN14K_form__atom_t lst_0 = al_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
      _fx_N14K_form__atom_t* a_0 = &lst_0->hd;
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
      if ((v_0 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
         FX_CALL(f_0->fp(a_0, loc_0, callb_0, f_0->fcv), _fx_catch_0);

      _fx_catch_0: ;
      }
      else {
         if (a_0->tag == 2) {
            _fx_N14K_form__klit_t* v_1 = &a_0->u.AtomLit;
            if (v_1->tag == 8) {
               FX_CALL(
                  _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_1->u.KLitNil, loc_0,
                     callb_0, 0), _fx_catch_1);

            _fx_catch_1: ;
               goto _fx_endmatch_0;
            }
         }

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_2);

      _fx_catch_2: ;
      }
      FX_CHECK_EXN(_fx_catch_3);

   _fx_catch_3: ;
      if (v_0) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
      }
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10fold_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, loc_0, callb_0, 0),
      _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM8fold_id_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_0 = 0;
   int fx_status = 0;
   FX_COPY_PTR(callb_0->kcb_fold_atom, &v_0);
   if ((v_0 != 0) + 1 == 2) {
      _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_0->u.Some;
      bool res_0;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_0, 0), _fx_cleanup);
      if (!res_0) {
         _fx_N14K_form__atom_t v_1 = {0};
         _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_1);
         FX_CALL(f_0->fp(&v_1, loc_0, callb_0, f_0->fcv), _fx_catch_0);

      _fx_catch_0: ;
         _fx_free_N14K_form__atom_t(&v_1);
         goto _fx_endmatch_0;
      }
   }

_fx_endmatch_0: ;

_fx_cleanup: ;
   if (v_0) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_0);
   }
   return fx_status;
}

static int _fx_M6K_formFM12fold_idlist_v4LR9Ast__id_tR10Ast__loc_tBRM14k_fold_callb_t(
   struct _fx_LR9Ast__id_t_data_t* nl_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool kvals_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LR9Ast__id_t lst_0 = nl_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_R17K_form__kdefval_t v_0 = {0};
      _fx_N14K_form__ktyp_t kv_typ_0 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_1 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_3 = 0;
      _fx_R9Ast__id_t* n_0 = &lst_0->hd;
      if (kvals_0) {
         bool t_0;
         if (n_0->m > 0) {
            t_0 = n_0->i > 0;
         }
         else {
            t_0 = false;
         }
         if (t_0) {
            FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(n_0, loc_0, &v_0, 0), _fx_catch_3);
            FX_COPY_PTR(v_0.kv_typ, &kv_typ_0);
            FX_CALL(
               _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kv_typ_0, loc_0, callb_0, 0),
               _fx_catch_3);
            FX_COPY_PTR(callb_0->kcb_fold_atom, &v_1);
            if ((v_1 != 0) + 1 == 2) {
               _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_1->u.Some;
               bool res_0;
               FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_3);
               if (!res_0) {
                  _fx_N14K_form__atom_t v_4 = {0};
                  _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_4);
                  FX_CALL(f_0->fp(&v_4, loc_0, callb_0, f_0->fcv), _fx_catch_0);

               _fx_catch_0: ;
                  _fx_free_N14K_form__atom_t(&v_4);
                  goto _fx_endmatch_0;
               }
            }

         _fx_endmatch_0: ;
            FX_CHECK_EXN(_fx_catch_3);
         }
         else {
            FX_COPY_PTR(callb_0->kcb_fold_atom, &v_2);
            if ((v_2 != 0) + 1 == 2) {
               _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_1 = &v_2->u.Some;
               bool res_1;
               FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_1, 0), _fx_catch_3);
               if (!res_1) {
                  _fx_N14K_form__atom_t v_5 = {0};
                  _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_5);
                  FX_CALL(f_1->fp(&v_5, loc_0, callb_0, f_1->fcv), _fx_catch_1);

               _fx_catch_1: ;
                  _fx_free_N14K_form__atom_t(&v_5);
                  goto _fx_endmatch_1;
               }
            }

         _fx_endmatch_1: ;
            FX_CHECK_EXN(_fx_catch_3);
         }
      }
      else {
         FX_COPY_PTR(callb_0->kcb_fold_atom, &v_3);
         if ((v_3 != 0) + 1 == 2) {
            _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_2 = &v_3->u.Some;
            bool res_2;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_2, 0), _fx_catch_3);
            if (!res_2) {
               _fx_N14K_form__atom_t v_6 = {0};
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_6);
               FX_CALL(f_2->fp(&v_6, loc_0, callb_0, f_2->fcv), _fx_catch_2);

            _fx_catch_2: ;
               _fx_free_N14K_form__atom_t(&v_6);
               goto _fx_endmatch_2;
            }
         }

      _fx_endmatch_2: ;
         FX_CHECK_EXN(_fx_catch_3);
      }

   _fx_catch_3: ;
      if (v_3) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_3);
      }
      if (v_2) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
      }
      if (v_1) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_1);
      }
      if (kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kv_typ_0);
      }
      _fx_free_R17K_form__kdefval_t(&v_0);
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t(struct _fx_N14K_form__kexp_t_data_t* e_0, void* fx_fv)
{
   int fx_status = 0;
   _fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t_cldata_t* cv_0 =
      (_fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t_cldata_t*)fx_fv;
   FX_CALL(_fx_M6K_formFM17check_n_fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_0, &cv_0->t0, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv1N14K_form__kexp_t1RM14k_fold_callb_t(
   struct _fx_R22K_form__k_fold_callb_t* arg0,
   struct _fx_FPv1N14K_form__kexp_t* fx_result)
{
   FX_MAKE_FP_IMPL_START(_fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t_cldata_t,
      _fx_free_M6K_formFM10fold_kexp_v1N14K_form__kexp_t, _fx_M6K_formFM10fold_kexp_v1N14K_form__kexp_t);
   _fx_copy_R22K_form__k_fold_callb_t(arg0, &fcv->t0);
   return 0;
}

static int _fx_M6K_formFM9fold_dom_v3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N13K_form__dom_t* d_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM16check_n_fold_domv3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(d_0, loc_0, callb_0, 0),
      _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM11fold_idoml_v3LT2R9Ast__id_tN13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_LT2R9Ast__id_tN13K_form__dom_t_data_t* idoml_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_LT2R9Ast__id_tN13K_form__dom_t lst_0 = idoml_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N13K_form__dom_t d_0 = {0};
      _fx_R17K_form__kdefval_t v_0 = {0};
      _fx_N14K_form__ktyp_t kv_typ_0 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_1 = 0;
      _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
      _fx_T2R9Ast__id_tN13K_form__dom_t* __pat___0 = &lst_0->hd;
      _fx_R9Ast__id_t k_0 = __pat___0->t0;
      _fx_copy_N13K_form__dom_t(&__pat___0->t1, &d_0);
      bool t_0;
      if (k_0.m > 0) {
         t_0 = k_0.i > 0;
      }
      else {
         t_0 = false;
      }
      if (t_0) {
         FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(&k_0, loc_0, &v_0, 0), _fx_catch_2);
         FX_COPY_PTR(v_0.kv_typ, &kv_typ_0);
         FX_CALL(
            _fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kv_typ_0, loc_0, callb_0, 0),
            _fx_catch_2);
         FX_COPY_PTR(callb_0->kcb_fold_atom, &v_1);
         if ((v_1 != 0) + 1 == 2) {
            _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_1->u.Some;
            bool res_0;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&k_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_2);
            if (!res_0) {
               _fx_N14K_form__atom_t v_3 = {0};
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&k_0, &v_3);
               FX_CALL(f_0->fp(&v_3, loc_0, callb_0, f_0->fcv), _fx_catch_0);

            _fx_catch_0: ;
               _fx_free_N14K_form__atom_t(&v_3);
               goto _fx_endmatch_0;
            }
         }

      _fx_endmatch_0: ;
         FX_CHECK_EXN(_fx_catch_2);
      }
      else {
         FX_COPY_PTR(callb_0->kcb_fold_atom, &v_2);
         if ((v_2 != 0) + 1 == 2) {
            _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_1 = &v_2->u.Some;
            bool res_1;
            FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(&k_0, &_fx_g9Ast__noid, &res_1, 0), _fx_catch_2);
            if (!res_1) {
               _fx_N14K_form__atom_t v_4 = {0};
               _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&k_0, &v_4);
               FX_CALL(f_1->fp(&v_4, loc_0, callb_0, f_1->fcv), _fx_catch_1);

            _fx_catch_1: ;
               _fx_free_N14K_form__atom_t(&v_4);
               goto _fx_endmatch_1;
            }
         }

      _fx_endmatch_1: ;
         FX_CHECK_EXN(_fx_catch_2);
      }
      FX_CALL(_fx_M6K_formFM16check_n_fold_domv3N13K_form__dom_tR10Ast__loc_tRM14k_fold_callb_t(&d_0, loc_0, callb_0, 0),
         _fx_catch_2);

   _fx_catch_2: ;
      if (v_2) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
      }
      if (v_1) {
         _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_1);
      }
      if (kv_typ_0) {
         _fx_free_N14K_form__ktyp_t(&kv_typ_0);
      }
      _fx_free_R17K_form__kdefval_t(&v_0);
      _fx_free_N13K_form__dom_t(&d_0);
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

static int _fx_M6K_formFM10fold_kval_v3R9Ast__id_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_R17K_form__kdefval_t v_0 = {0};
   _fx_N14K_form__ktyp_t kv_typ_0 = 0;
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_1 = 0;
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
   int fx_status = 0;
   bool t_0;
   if (n_0->m > 0) {
      t_0 = n_0->i > 0;
   }
   else {
      t_0 = false;
   }
   if (t_0) {
      FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      FX_COPY_PTR(v_0.kv_typ, &kv_typ_0);
      FX_CALL(_fx_M6K_formFM17check_n_fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kv_typ_0, loc_0, callb_0, 0),
         _fx_cleanup);
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_1);
      if ((v_1 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_0 = &v_1->u.Some;
         bool res_0;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_0, 0), _fx_cleanup);
         if (!res_0) {
            _fx_N14K_form__atom_t v_3 = {0};
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_3);
            FX_CALL(f_0->fp(&v_3, loc_0, callb_0, f_0->fcv), _fx_catch_0);

         _fx_catch_0: ;
            _fx_free_N14K_form__atom_t(&v_3);
            goto _fx_endmatch_0;
         }
      }

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   else {
      FX_COPY_PTR(callb_0->kcb_fold_atom, &v_2);
      if ((v_2 != 0) + 1 == 2) {
         _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* f_1 = &v_2->u.Some;
         bool res_1;
         FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(n_0, &_fx_g9Ast__noid, &res_1, 0), _fx_cleanup);
         if (!res_1) {
            _fx_N14K_form__atom_t v_4 = {0};
            _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(n_0, &v_4);
            FX_CALL(f_1->fp(&v_4, loc_0, callb_0, f_1->fcv), _fx_catch_1);

         _fx_catch_1: ;
            _fx_free_N14K_form__atom_t(&v_4);
            goto _fx_endmatch_1;
         }
      }

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   _fx_free_R17K_form__kdefval_t(&v_0);
   if (kv_typ_0) {
      _fx_free_N14K_form__ktyp_t(&kv_typ_0);
   }
   if (v_1) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_1);
   }
   if (v_2) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM13used_by_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, loc_0, callb_0, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7used_byNt10Hashset__t1R9Ast__id_t2LN14K_form__kexp_ti(
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   int_ size0_0,
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   _fx_Nt10Hashset__t1R9Ast__id_t all_used_0 = 0;
   _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t used_by_atom__0 = {0};
   _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t used_by_kexp__0 = {0};
   _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t used_by_ktyp__0 = {0};
   _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
   _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t v_3 = 0;
   _fx_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t v_4 = 0;
   _fx_R22K_form__k_fold_callb_t used_decl_callb_0 = {0};
   int fx_status = 0;
   int_ size_0 = 8;
   while (size_0 < size0_0) {
      size_0 = size_0 * 2;
   }
   int_ idxsize_0 = size_0 * 2;
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t entry0_0 = { 0ULL, _fx_g9Ast__noid };
   FX_CALL(_fx_M7HashsetFM9makeindexA1i1i(idxsize_0, &v_0, 0), _fx_cleanup);
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* dstptr_0 = 0;
   int_ n_0 = size_0;
   {
      const int_ shape_0[] = { n_0 };
      FX_CALL(fx_make_arr(1, shape_0, sizeof(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t), 0, 0, 0, &v_1), _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t*)v_1.data;
   for (int_ i_0 = 0; i_0 < n_0; i_0++, dstptr_0++) {
      *dstptr_0 = entry0_0;
   }
   FX_CALL(
      _fx_M6K_formFM1tNt10Hashset__t1R9Ast__id_t6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
         &entry0_0, 0, 0, 0, &v_0, &v_1, &all_used_0), _fx_cleanup);
   _fx_M6K_formFM7make_fpFPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(all_used_0,
      &used_by_atom__0);
   _fx_M6K_formFM7make_fpFPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(all_used_0, &used_by_kexp__0);
   _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t used_by_ktyp__fp_0 =
      { _fx_M6K_formFM13used_by_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t, 0 };
   FX_COPY_FP(&used_by_ktyp__fp_0, &used_by_ktyp__0);
   FX_CALL(
      _fx_M6K_formFM4SomeNt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
         &used_by_ktyp__0, &v_2), _fx_cleanup);
   FX_CALL(
      _fx_M6K_formFM4SomeNt6option1FPv2N14K_form__kexp_tRM14k_fold_callb_t1FPv2N14K_form__kexp_tRM14k_fold_callb_t(
         &used_by_kexp__0, &v_3), _fx_cleanup);
   FX_CALL(
      _fx_M6K_formFM4SomeNt6option1FPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t1FPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
         &used_by_atom__0, &v_4), _fx_cleanup);
   _fx_make_R22K_form__k_fold_callb_t(v_2, v_3, v_4, &used_decl_callb_0);
   _fx_LN14K_form__kexp_t lst_0 = code_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N14K_form__kexp_t e_0 = lst_0->hd;
      FX_CALL(used_by_kexp__0.fp(e_0, &used_decl_callb_0, used_by_kexp__0.fcv), _fx_catch_0);

   _fx_catch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(all_used_0, fx_result);

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   if (all_used_0) {
      _fx_free_Nt10Hashset__t1R9Ast__id_t(&all_used_0);
   }
   FX_FREE_FP(&used_by_atom__0);
   FX_FREE_FP(&used_by_kexp__0);
   FX_FREE_FP(&used_by_ktyp__0);
   if (v_2) {
      _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
   }
   if (v_3) {
      _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(&v_3);
   }
   if (v_4) {
      _fx_free_Nt6option1FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_4);
   }
   _fx_free_R22K_form__k_fold_callb_t(&used_decl_callb_0);
   return fx_status;
}

static int _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t_cldata_t* cv_0 =
      (_fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t_cldata_t*)fx_fv;
   int tag_0 = a_0->tag;
   if (tag_0 == 1) {
      _fx_R9Ast__id_t* n_0 = &a_0->u.AtomId;
      if (n_0->m > 0) {
         uint64_t __fold_result___0 = 14695981039346656037ULL;
         uint64_t h_0 = __fold_result___0 ^ ((uint64_t)n_0->m ^ 14695981039346656037ULL);
         __fold_result___0 = h_0 * 1099511628211ULL;
         uint64_t h_1 = __fold_result___0 ^ ((uint64_t)n_0->i ^ 14695981039346656037ULL);
         __fold_result___0 = h_1 * 1099511628211ULL;
         uint64_t h_2 = __fold_result___0 ^ ((uint64_t)n_0->j ^ 14695981039346656037ULL);
         __fold_result___0 = h_2 * 1099511628211ULL;
         FX_CALL(
            _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(cv_0->t0, n_0,
               __fold_result___0 & 9223372036854775807ULL, 0), _fx_catch_0);
      }

   _fx_catch_0: ;
      goto _fx_endmatch_0;
   }
   if (tag_0 == 2) {
      _fx_N14K_form__klit_t* v_0 = &a_0->u.AtomLit;
      if (v_0->tag == 8) {
         FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_0->u.KLitNil, loc_0, callb_0, 0),
            _fx_catch_1);

      _fx_catch_1: ;
         goto _fx_endmatch_0;
      }
   }

_fx_endmatch_0: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv3N14K_form__atom_tR10Ast__loc_tR22K_form__k_fold_callb_t* fx_result)
{
   FX_MAKE_FP_IMPL_START(_fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t_cldata_t,
      _fx_free_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t,
      _fx_M6K_formFM13used_by_atom_v3N14K_form__atom_tR10Ast__loc_tRM14k_fold_callb_t);
   FX_COPY_PTR(arg0, &fcv->t0);
   return 0;
}

static int _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_N14K_form__kexp_t e_1 = 0;
   _fx_R22K_form__k_fold_callb_t callb_1 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t* cv_0 =
      (_fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t*)fx_fv;
   _fx_Nt10Hashset__t1R9Ast__id_t all_used_0 = cv_0->t0;
   FX_COPY_PTR(e_0, &e_1);
   _fx_copy_R22K_form__k_fold_callb_t(callb_0, &callb_1);
   for (;;) {
      _fx_N14K_form__kexp_t e_2 = 0;
      _fx_R22K_form__k_fold_callb_t callb_2 = {0};
      FX_COPY_PTR(e_1, &e_2);
      _fx_copy_R22K_form__k_fold_callb_t(&callb_1, &callb_2);
      int tag_0 = FX_REC_VARIANT_TAG(e_2);
      if (tag_0 == 31) {
         _fx_R17K_form__kdefval_t v_0 = {0};
         _fx_R16Ast__val_flags_t kv_flags_0 = {0};
         _fx_N14K_form__ktyp_t kv_typ_0 = 0;
         _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* vcase_0 = &e_2->u.KDefVal;
         _fx_R10Ast__loc_t* loc_0 = &vcase_0->t2;
         FX_CALL(_fx_M6K_formFM8get_kvalRM9kdefval_t2R9Ast__id_tR10Ast__loc_t(&vcase_0->t0, loc_0, &v_0, 0), _fx_catch_0);
         _fx_copy_R16Ast__val_flags_t(&v_0.kv_flags, &kv_flags_0);
         FX_COPY_PTR(v_0.kv_typ, &kv_typ_0);
         bool is_ctor_0 = kv_flags_0.val_flag_ctor > 0;
         if (!is_ctor_0) {
            FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kv_typ_0, loc_0, &callb_2, 0),
               _fx_catch_0);
            _fx_N14K_form__kexp_t* e_3 = &vcase_0->t1;
            _fx_free_N14K_form__kexp_t(&e_1);
            FX_COPY_PTR(*e_3, &e_1);
            _fx_free_R22K_form__k_fold_callb_t(&callb_1);
            _fx_copy_R22K_form__k_fold_callb_t(&callb_2, &callb_1);
         }
         else {
            FX_BREAK(_fx_catch_0);
         }

      _fx_catch_0: ;
         if (kv_typ_0) {
            _fx_free_N14K_form__ktyp_t(&kv_typ_0);
         }
         _fx_free_R16Ast__val_flags_t(&kv_flags_0);
         _fx_free_R17K_form__kdefval_t(&v_0);
      }
      else if (tag_0 == 32) {
         _fx_R17K_form__kdeffun_t v_1 = {0};
         _fx_N14K_form__ktyp_t v_2 = 0;
         _fx_N14K_form__ktyp_t kf_typ_0 = 0;
         _fx_copy_R17K_form__kdeffun_t(&e_2->u.KDefFun->data, &v_1);
         _fx_R10Ast__loc_t* kf_loc_0 = &v_1.kf_loc;
         _fx_R25K_form__kdefclosureinfo_t* kf_closure_0 = &v_1.kf_closure;
         _fx_R9Ast__id_t* kf_name_0 = &v_1.kf_name;
         _fx_R9Ast__id_t kci_fcv_t_0 = kf_closure_0->kci_fcv_t;
         _fx_R9Ast__id_t kci_arg_0 = kf_closure_0->kci_arg;
         _fx_N17Ast__fun_constr_t v_3 = v_1.kf_flags.fun_flag_ctor;
         bool is_ctor_1 = v_3.tag != 1;
         if (is_ctor_1) {
            FX_COPY_PTR(_fx_g16K_form__KTypVoid, &v_2);
         }
         else {
            FX_COPY_PTR(v_1.kf_rt, &v_2);
         }
         FX_CALL(
            _fx_M6K_formFM10get_kf_typN14K_form__ktyp_t3LR9Ast__id_tN14K_form__ktyp_tR10Ast__loc_t(v_1.kf_params, v_2, kf_loc_0,
               &kf_typ_0, 0), _fx_catch_1);
         FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(kf_typ_0, kf_loc_0, &callb_2, 0),
            _fx_catch_1);
         uint64_t __fold_result___0 = 14695981039346656037ULL;
         uint64_t h_0 = __fold_result___0 ^ ((uint64_t)kf_name_0->m ^ 14695981039346656037ULL);
         __fold_result___0 = h_0 * 1099511628211ULL;
         uint64_t h_1 = __fold_result___0 ^ ((uint64_t)kf_name_0->i ^ 14695981039346656037ULL);
         __fold_result___0 = h_1 * 1099511628211ULL;
         uint64_t h_2 = __fold_result___0 ^ ((uint64_t)kf_name_0->j ^ 14695981039346656037ULL);
         __fold_result___0 = h_2 * 1099511628211ULL;
         _fx_Ta2i v_4;
         FX_CALL(
            _fx_M6K_formFM9find_idx_Ta2i3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, kf_name_0,
               __fold_result___0 & 9223372036854775807ULL, &v_4, 0), _fx_catch_1);
         bool have_kf_name_0 = v_4.t1 >= 0;
         if (!is_ctor_1) {
            FX_CALL(_fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(v_1.kf_body, &callb_2, fx_fv),
               _fx_catch_1);
         }
         if (!have_kf_name_0) {
            FX_CALL(_fx_M6K_formFM6removev2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, kf_name_0, 0), _fx_catch_1);
         }
         if (kci_arg_0.m > 0) {
            uint64_t __fold_result___1 = 14695981039346656037ULL;
            uint64_t h_3 = __fold_result___1 ^ ((uint64_t)kci_arg_0.m ^ 14695981039346656037ULL);
            __fold_result___1 = h_3 * 1099511628211ULL;
            uint64_t h_4 = __fold_result___1 ^ ((uint64_t)kci_arg_0.i ^ 14695981039346656037ULL);
            __fold_result___1 = h_4 * 1099511628211ULL;
            uint64_t h_5 = __fold_result___1 ^ ((uint64_t)kci_arg_0.j ^ 14695981039346656037ULL);
            __fold_result___1 = h_5 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, &kci_arg_0,
                  __fold_result___1 & 9223372036854775807ULL, 0), _fx_catch_1);
         }
         if (kci_fcv_t_0.m > 0) {
            uint64_t __fold_result___2 = 14695981039346656037ULL;
            uint64_t h_6 = __fold_result___2 ^ ((uint64_t)kci_fcv_t_0.m ^ 14695981039346656037ULL);
            __fold_result___2 = h_6 * 1099511628211ULL;
            uint64_t h_7 = __fold_result___2 ^ ((uint64_t)kci_fcv_t_0.i ^ 14695981039346656037ULL);
            __fold_result___2 = h_7 * 1099511628211ULL;
            uint64_t h_8 = __fold_result___2 ^ ((uint64_t)kci_fcv_t_0.j ^ 14695981039346656037ULL);
            __fold_result___2 = h_8 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, &kci_fcv_t_0,
                  __fold_result___2 & 9223372036854775807ULL, 0), _fx_catch_1);
         }
         FX_BREAK(_fx_catch_1);

      _fx_catch_1: ;
         if (kf_typ_0) {
            _fx_free_N14K_form__ktyp_t(&kf_typ_0);
         }
         if (v_2) {
            _fx_free_N14K_form__ktyp_t(&v_2);
         }
         _fx_free_R17K_form__kdeffun_t(&v_1);
      }
      else if (tag_0 == 33) {
         _fx_R17K_form__kdefexn_t v_5 = {0};
         _fx_copy_R17K_form__kdefexn_t(&e_2->u.KDefExn->data, &v_5);
         _fx_R9Ast__id_t* ke_make_0 = &v_5.ke_make;
         _fx_R9Ast__id_t* ke_tag_0 = &v_5.ke_tag;
         FX_CALL(
            _fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_5.ke_typ, &v_5.ke_loc, &callb_2, 0),
            _fx_catch_2);
         if (ke_tag_0->m > 0) {
            uint64_t __fold_result___3 = 14695981039346656037ULL;
            uint64_t h_9 = __fold_result___3 ^ ((uint64_t)ke_tag_0->m ^ 14695981039346656037ULL);
            __fold_result___3 = h_9 * 1099511628211ULL;
            uint64_t h_10 = __fold_result___3 ^ ((uint64_t)ke_tag_0->i ^ 14695981039346656037ULL);
            __fold_result___3 = h_10 * 1099511628211ULL;
            uint64_t h_11 = __fold_result___3 ^ ((uint64_t)ke_tag_0->j ^ 14695981039346656037ULL);
            __fold_result___3 = h_11 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, ke_tag_0,
                  __fold_result___3 & 9223372036854775807ULL, 0), _fx_catch_2);
         }
         if (ke_make_0->m > 0) {
            uint64_t __fold_result___4 = 14695981039346656037ULL;
            uint64_t h_12 = __fold_result___4 ^ ((uint64_t)ke_make_0->m ^ 14695981039346656037ULL);
            __fold_result___4 = h_12 * 1099511628211ULL;
            uint64_t h_13 = __fold_result___4 ^ ((uint64_t)ke_make_0->i ^ 14695981039346656037ULL);
            __fold_result___4 = h_13 * 1099511628211ULL;
            uint64_t h_14 = __fold_result___4 ^ ((uint64_t)ke_make_0->j ^ 14695981039346656037ULL);
            __fold_result___4 = h_14 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, ke_make_0,
                  __fold_result___4 & 9223372036854775807ULL, 0), _fx_catch_2);
         }
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         _fx_free_R17K_form__kdefexn_t(&v_5);
      }
      else if (tag_0 == 34) {
         _fx_R21K_form__kdefvariant_t v_6 = {0};
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t kvar_cases_0 = 0;
         _fx_LT2R9Ast__id_tLR9Ast__id_t kvar_ifaces_0 = 0;
         _fx_copy_R21K_form__kdefvariant_t(&e_2->u.KDefVariant->data, &v_6);
         _fx_R9Ast__id_t* kvar_name_0 = &v_6.kvar_name;
         uint64_t __fold_result___5 = 14695981039346656037ULL;
         uint64_t h_15 = __fold_result___5 ^ ((uint64_t)kvar_name_0->m ^ 14695981039346656037ULL);
         __fold_result___5 = h_15 * 1099511628211ULL;
         uint64_t h_16 = __fold_result___5 ^ ((uint64_t)kvar_name_0->i ^ 14695981039346656037ULL);
         __fold_result___5 = h_16 * 1099511628211ULL;
         uint64_t h_17 = __fold_result___5 ^ ((uint64_t)kvar_name_0->j ^ 14695981039346656037ULL);
         __fold_result___5 = h_17 * 1099511628211ULL;
         _fx_Ta2i v_7;
         FX_CALL(
            _fx_M6K_formFM9find_idx_Ta2i3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_used_0, kvar_name_0,
               __fold_result___5 & 9223372036854775807ULL, &v_7, 0), _fx_catch_6);
         bool have_kvar_name_0 = v_7.t1 >= 0;
         FX_COPY_PTR(v_6.kvar_cases, &kvar_cases_0);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_0 = kvar_cases_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_N14K_form__ktyp_t ti_0 = 0;
            _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___0 = &lst_0->hd;
            _fx_R9Ast__id_t ni_0 = __pat___0->t0;
            FX_COPY_PTR(__pat___0->t1, &ti_0);
            if (ni_0.m > 0) {
               FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, &ni_0, 0), _fx_catch_3);
            }
            FX_CALL(
               _fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(ti_0, &v_6.kvar_loc, &callb_2, 0),
               _fx_catch_3);

         _fx_catch_3: ;
            if (ti_0) {
               _fx_free_N14K_form__ktyp_t(&ti_0);
            }
            FX_CHECK_EXN(_fx_catch_6);
         }
         FX_COPY_PTR(v_6.kvar_ifaces, &kvar_ifaces_0);
         _fx_LT2R9Ast__id_tLR9Ast__id_t lst_1 = kvar_ifaces_0;
         for (; lst_1; lst_1 = lst_1->tl) {
            _fx_LR9Ast__id_t methods_0 = 0;
            _fx_T2R9Ast__id_tLR9Ast__id_t* __pat___1 = &lst_1->hd;
            _fx_R9Ast__id_t iname_0 = __pat___1->t0;
            FX_COPY_PTR(__pat___1->t1, &methods_0);
            if (iname_0.m > 0) {
               FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, &iname_0, 0), _fx_catch_5);
            }
            _fx_LR9Ast__id_t lst_2 = methods_0;
            for (; lst_2; lst_2 = lst_2->tl) {
               _fx_R9Ast__id_t* m_0 = &lst_2->hd;
               if (m_0->m > 0) {
                  FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, m_0, 0), _fx_catch_4);
               }

            _fx_catch_4: ;
               FX_CHECK_EXN(_fx_catch_5);
            }

         _fx_catch_5: ;
            FX_FREE_LIST_SIMPLE(&methods_0);
            FX_CHECK_EXN(_fx_catch_6);
         }
         if (!have_kvar_name_0) {
            FX_CALL(_fx_M6K_formFM6removev2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, kvar_name_0, 0), _fx_catch_6);
         }
         FX_BREAK(_fx_catch_6);

      _fx_catch_6: ;
         if (kvar_ifaces_0) {
            _fx_free_LT2R9Ast__id_tLR9Ast__id_t(&kvar_ifaces_0);
         }
         if (kvar_cases_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&kvar_cases_0);
         }
         _fx_free_R21K_form__kdefvariant_t(&v_6);
      }
      else if (tag_0 == 37) {
         FX_BREAK(_fx_catch_7);  _fx_catch_7: ;
      }
      else if (tag_0 == 35) {
         _fx_R23K_form__kdefinterface_t v_8 = {0};
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t ki_all_methods_0 = 0;
         _fx_copy_R23K_form__kdefinterface_t(&e_2->u.KDefInterface->data, &v_8);
         _fx_R9Ast__id_t* ki_id_0 = &v_8.ki_id;
         _fx_R9Ast__id_t* ki_base_0 = &v_8.ki_base;
         if (ki_base_0->m > 0) {
            FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, ki_base_0, 0), _fx_catch_9);
         }
         if (ki_id_0->m > 0) {
            FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, ki_id_0, 0), _fx_catch_9);
         }
         FX_COPY_PTR(v_8.ki_all_methods, &ki_all_methods_0);
         _fx_LT2R9Ast__id_tN14K_form__ktyp_t lst_3 = ki_all_methods_0;
         for (; lst_3; lst_3 = lst_3->tl) {
            _fx_N14K_form__ktyp_t t_0 = 0;
            _fx_T2R9Ast__id_tN14K_form__ktyp_t* __pat___2 = &lst_3->hd;
            _fx_R9Ast__id_t f_0 = __pat___2->t0;
            FX_COPY_PTR(__pat___2->t1, &t_0);
            if (f_0.m > 0) {
               FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, &f_0, 0), _fx_catch_8);
            }
            FX_CALL(_fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(t_0, &v_8.ki_loc, &callb_2, 0),
               _fx_catch_8);

         _fx_catch_8: ;
            if (t_0) {
               _fx_free_N14K_form__ktyp_t(&t_0);
            }
            FX_CHECK_EXN(_fx_catch_9);
         }
         FX_BREAK(_fx_catch_9);

      _fx_catch_9: ;
         if (ki_all_methods_0) {
            _fx_free_LT2R9Ast__id_tN14K_form__ktyp_t(&ki_all_methods_0);
         }
         _fx_free_R23K_form__kdefinterface_t(&v_8);
      }
      else if (tag_0 == 36) {
         _fx_R17K_form__kdeftyp_t v_9 = {0};
         _fx_copy_R17K_form__kdeftyp_t(&e_2->u.KDefTyp->data, &v_9);
         _fx_R9Ast__id_t* kt_name_0 = &v_9.kt_name;
         bool have_kt_name_0;
         FX_CALL(_fx_M6K_formFM3memB2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, kt_name_0, &have_kt_name_0, 0),
            _fx_catch_10);
         FX_CALL(
            _fx_M6K_formFM9fold_ktypv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(v_9.kt_typ, &v_9.kt_loc, &callb_2, 0),
            _fx_catch_10);
         if (!have_kt_name_0) {
            FX_CALL(_fx_M6K_formFM6removev2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_used_0, kt_name_0, 0), _fx_catch_10);
         }
         FX_BREAK(_fx_catch_10);

      _fx_catch_10: ;
         _fx_free_R17K_form__kdeftyp_t(&v_9);
      }
      else {
         FX_CALL(_fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_2, &callb_2, 0), _fx_catch_11);
         FX_BREAK(_fx_catch_11);

      _fx_catch_11: ;
      }
      FX_CHECK_EXN(_fx_catch_12);

   _fx_catch_12: ;
      _fx_free_R22K_form__k_fold_callb_t(&callb_2);
      if (e_2) {
         _fx_free_N14K_form__kexp_t(&e_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   if (e_1) {
      _fx_free_N14K_form__kexp_t(&e_1);
   }
   _fx_free_R22K_form__k_fold_callb_t(&callb_1);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7make_fpFPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* fx_result)
{
   FX_MAKE_FP_IMPL_START(_fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t,
      _fx_free_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t,
      _fx_M6K_formFM13used_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t);
   FX_COPY_PTR(arg0, &fcv->t0);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM13decl_by_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   int fx_status = 0;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM8declaredNt10Hashset__t1R9Ast__id_t2LN14K_form__kexp_ti(
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   int_ size0_0,
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t** fx_result,
   void* fx_fv)
{
   fx_arr_t v_0 = {0};
   fx_arr_t v_1 = {0};
   _fx_Nt10Hashset__t1R9Ast__id_t all_decl_0 = 0;
   _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t decl_by_kexp__0 = {0};
   _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t decl_by_ktyp__0 = {0};
   _fx_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t v_2 = 0;
   _fx_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t v_3 = 0;
   _fx_R22K_form__k_fold_callb_t decl_callb_0 = {0};
   int fx_status = 0;
   int_ size_0 = 8;
   while (size_0 < size0_0) {
      size_0 = size_0 * 2;
   }
   int_ idxsize_0 = size_0 * 2;
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t entry0_0 = { 0ULL, _fx_g9Ast__noid };
   FX_CALL(_fx_M7HashsetFM9makeindexA1i1i(idxsize_0, &v_0, 0), _fx_cleanup);
   _fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t* dstptr_0 = 0;
   int_ n_0 = size_0;
   {
      const int_ shape_0[] = { n_0 };
      FX_CALL(fx_make_arr(1, shape_0, sizeof(_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t), 0, 0, 0, &v_1), _fx_cleanup);
   }
   dstptr_0 = (_fx_Rt24Hashset__hashset_entry_t1R9Ast__id_t*)v_1.data;
   for (int_ i_0 = 0; i_0 < n_0; i_0++, dstptr_0++) {
      *dstptr_0 = entry0_0;
   }
   FX_CALL(
      _fx_M6K_formFM1tNt10Hashset__t1R9Ast__id_t6Rt24Hashset__hashset_entry_t1R9Ast__id_tiiiA1iA1Rt24Hashset__hashset_entry_t1R9Ast__id_t(
         &entry0_0, 0, 0, 0, &v_0, &v_1, &all_decl_0), _fx_cleanup);
   _fx_M6K_formFM9make_fp1_FPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(all_decl_0, &decl_by_kexp__0);
   _fx_FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t decl_by_ktyp__fp_0 =
      { _fx_M6K_formFM13decl_by_ktyp_v3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t, 0 };
   FX_COPY_FP(&decl_by_ktyp__fp_0, &decl_by_ktyp__0);
   FX_CALL(
      _fx_M6K_formFM4SomeNt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t1FPv3N14K_form__ktyp_tR10Ast__loc_tRM14k_fold_callb_t(
         &decl_by_ktyp__0, &v_2), _fx_cleanup);
   FX_CALL(
      _fx_M6K_formFM4SomeNt6option1FPv2N14K_form__kexp_tRM14k_fold_callb_t1FPv2N14K_form__kexp_tRM14k_fold_callb_t(
         &decl_by_kexp__0, &v_3), _fx_cleanup);
   _fx_make_R22K_form__k_fold_callb_t(v_2, v_3, _fx_g14K_form__None1_, &decl_callb_0);
   _fx_LN14K_form__kexp_t lst_0 = code_0;
   for (; lst_0; lst_0 = lst_0->tl) {
      _fx_N14K_form__kexp_t e_0 = lst_0->hd;
      FX_CALL(decl_by_kexp__0.fp(e_0, &decl_callb_0, decl_by_kexp__0.fcv), _fx_catch_0);

   _fx_catch_0: ;
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(all_decl_0, fx_result);

_fx_cleanup: ;
   FX_FREE_ARR(&v_0);
   FX_FREE_ARR(&v_1);
   if (all_decl_0) {
      _fx_free_Nt10Hashset__t1R9Ast__id_t(&all_decl_0);
   }
   FX_FREE_FP(&decl_by_kexp__0);
   FX_FREE_FP(&decl_by_ktyp__0);
   if (v_2) {
      _fx_free_Nt6option1FPv3N14K_form__ktyp_tR10Ast__loc_tR22K_form__k_fold_callb_t(&v_2);
   }
   if (v_3) {
      _fx_free_Nt6option1FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t(&v_3);
   }
   _fx_free_R22K_form__k_fold_callb_t(&decl_callb_0);
   return fx_status;
}

static int _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   struct _fx_R22K_form__k_fold_callb_t* callb_0,
   void* fx_fv)
{
   _fx_N14K_form__kexp_t e_1 = 0;
   _fx_R22K_form__k_fold_callb_t callb_1 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t* cv_0 =
      (_fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t*)fx_fv;
   _fx_Nt10Hashset__t1R9Ast__id_t all_decl_0 = cv_0->t0;
   FX_COPY_PTR(e_0, &e_1);
   _fx_copy_R22K_form__k_fold_callb_t(callb_0, &callb_1);
   for (;;) {
      _fx_N14K_form__kexp_t e_2 = 0;
      _fx_R22K_form__k_fold_callb_t callb_2 = {0};
      FX_COPY_PTR(e_1, &e_2);
      _fx_copy_R22K_form__k_fold_callb_t(&callb_1, &callb_2);
      int tag_0 = FX_REC_VARIANT_TAG(e_2);
      if (tag_0 == 31) {
         _fx_T3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t* vcase_0 = &e_2->u.KDefVal;
         _fx_R9Ast__id_t* n_0 = &vcase_0->t0;
         if (n_0->m > 0) {
            uint64_t __fold_result___0 = 14695981039346656037ULL;
            uint64_t h_0 = __fold_result___0 ^ ((uint64_t)n_0->m ^ 14695981039346656037ULL);
            __fold_result___0 = h_0 * 1099511628211ULL;
            uint64_t h_1 = __fold_result___0 ^ ((uint64_t)n_0->i ^ 14695981039346656037ULL);
            __fold_result___0 = h_1 * 1099511628211ULL;
            uint64_t h_2 = __fold_result___0 ^ ((uint64_t)n_0->j ^ 14695981039346656037ULL);
            __fold_result___0 = h_2 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, n_0,
                  __fold_result___0 & 9223372036854775807ULL, 0), _fx_catch_0);
         }
         _fx_N14K_form__kexp_t* e_3 = &vcase_0->t1;
         _fx_free_N14K_form__kexp_t(&e_1);
         FX_COPY_PTR(*e_3, &e_1);
         _fx_free_R22K_form__k_fold_callb_t(&callb_1);
         _fx_copy_R22K_form__k_fold_callb_t(&callb_2, &callb_1);

      _fx_catch_0: ;
      }
      else if (tag_0 == 32) {
         _fx_R17K_form__kdeffun_t v_0 = {0};
         _fx_LR9Ast__id_t kf_params_0 = 0;
         _fx_copy_R17K_form__kdeffun_t(&e_2->u.KDefFun->data, &v_0);
         _fx_R9Ast__id_t* kf_name_0 = &v_0.kf_name;
         _fx_R9Ast__id_t kci_arg_0 = v_0.kf_closure.kci_arg;
         FX_CALL(_fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t(v_0.kf_body, &callb_2, fx_fv), _fx_catch_2);
         if (kci_arg_0.m > 0) {
            uint64_t __fold_result___1 = 14695981039346656037ULL;
            uint64_t h_3 = __fold_result___1 ^ ((uint64_t)kci_arg_0.m ^ 14695981039346656037ULL);
            __fold_result___1 = h_3 * 1099511628211ULL;
            uint64_t h_4 = __fold_result___1 ^ ((uint64_t)kci_arg_0.i ^ 14695981039346656037ULL);
            __fold_result___1 = h_4 * 1099511628211ULL;
            uint64_t h_5 = __fold_result___1 ^ ((uint64_t)kci_arg_0.j ^ 14695981039346656037ULL);
            __fold_result___1 = h_5 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, &kci_arg_0,
                  __fold_result___1 & 9223372036854775807ULL, 0), _fx_catch_2);
         }
         if (kf_name_0->m > 0) {
            uint64_t __fold_result___2 = 14695981039346656037ULL;
            uint64_t h_6 = __fold_result___2 ^ ((uint64_t)kf_name_0->m ^ 14695981039346656037ULL);
            __fold_result___2 = h_6 * 1099511628211ULL;
            uint64_t h_7 = __fold_result___2 ^ ((uint64_t)kf_name_0->i ^ 14695981039346656037ULL);
            __fold_result___2 = h_7 * 1099511628211ULL;
            uint64_t h_8 = __fold_result___2 ^ ((uint64_t)kf_name_0->j ^ 14695981039346656037ULL);
            __fold_result___2 = h_8 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, kf_name_0,
                  __fold_result___2 & 9223372036854775807ULL, 0), _fx_catch_2);
         }
         FX_COPY_PTR(v_0.kf_params, &kf_params_0);
         _fx_LR9Ast__id_t lst_0 = kf_params_0;
         for (; lst_0; lst_0 = lst_0->tl) {
            _fx_R9Ast__id_t* a_0 = &lst_0->hd;
            if (a_0->m > 0) {
               uint64_t __fold_result___3 = 14695981039346656037ULL;
               uint64_t h_9 = __fold_result___3 ^ ((uint64_t)a_0->m ^ 14695981039346656037ULL);
               __fold_result___3 = h_9 * 1099511628211ULL;
               uint64_t h_10 = __fold_result___3 ^ ((uint64_t)a_0->i ^ 14695981039346656037ULL);
               __fold_result___3 = h_10 * 1099511628211ULL;
               uint64_t h_11 = __fold_result___3 ^ ((uint64_t)a_0->j ^ 14695981039346656037ULL);
               __fold_result___3 = h_11 * 1099511628211ULL;
               FX_CALL(
                  _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, a_0,
                     __fold_result___3 & 9223372036854775807ULL, 0), _fx_catch_1);
            }

         _fx_catch_1: ;
            FX_CHECK_EXN(_fx_catch_2);
         }
         FX_BREAK(_fx_catch_2);

      _fx_catch_2: ;
         FX_FREE_LIST_SIMPLE(&kf_params_0);
         _fx_free_R17K_form__kdeffun_t(&v_0);
      }
      else if (tag_0 == 37) {
         _fx_R25K_form__kdefclosurevars_t v_1 = {0};
         _fx_copy_R25K_form__kdefclosurevars_t(&e_2->u.KDefClosureVars->data, &v_1);
         _fx_R9Ast__id_t* kcv_name_0 = &v_1.kcv_name;
         if (kcv_name_0->m > 0) {
            uint64_t __fold_result___4 = 14695981039346656037ULL;
            uint64_t h_12 = __fold_result___4 ^ ((uint64_t)kcv_name_0->m ^ 14695981039346656037ULL);
            __fold_result___4 = h_12 * 1099511628211ULL;
            uint64_t h_13 = __fold_result___4 ^ ((uint64_t)kcv_name_0->i ^ 14695981039346656037ULL);
            __fold_result___4 = h_13 * 1099511628211ULL;
            uint64_t h_14 = __fold_result___4 ^ ((uint64_t)kcv_name_0->j ^ 14695981039346656037ULL);
            __fold_result___4 = h_14 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, kcv_name_0,
                  __fold_result___4 & 9223372036854775807ULL, 0), _fx_catch_3);
         }
         FX_BREAK(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_R25K_form__kdefclosurevars_t(&v_1);
      }
      else if (tag_0 == 35) {
         _fx_R23K_form__kdefinterface_t v_2 = {0};
         _fx_copy_R23K_form__kdefinterface_t(&e_2->u.KDefInterface->data, &v_2);
         _fx_R9Ast__id_t* ki_name_0 = &v_2.ki_name;
         if (ki_name_0->m > 0) {
            uint64_t __fold_result___5 = 14695981039346656037ULL;
            uint64_t h_15 = __fold_result___5 ^ ((uint64_t)ki_name_0->m ^ 14695981039346656037ULL);
            __fold_result___5 = h_15 * 1099511628211ULL;
            uint64_t h_16 = __fold_result___5 ^ ((uint64_t)ki_name_0->i ^ 14695981039346656037ULL);
            __fold_result___5 = h_16 * 1099511628211ULL;
            uint64_t h_17 = __fold_result___5 ^ ((uint64_t)ki_name_0->j ^ 14695981039346656037ULL);
            __fold_result___5 = h_17 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, ki_name_0,
                  __fold_result___5 & 9223372036854775807ULL, 0), _fx_catch_4);
         }
         FX_BREAK(_fx_catch_4);

      _fx_catch_4: ;
         _fx_free_R23K_form__kdefinterface_t(&v_2);
      }
      else if (tag_0 == 33) {
         _fx_R17K_form__kdefexn_t v_3 = {0};
         _fx_copy_R17K_form__kdefexn_t(&e_2->u.KDefExn->data, &v_3);
         _fx_R9Ast__id_t* ke_name_0 = &v_3.ke_name;
         if (ke_name_0->m > 0) {
            uint64_t __fold_result___6 = 14695981039346656037ULL;
            uint64_t h_18 = __fold_result___6 ^ ((uint64_t)ke_name_0->m ^ 14695981039346656037ULL);
            __fold_result___6 = h_18 * 1099511628211ULL;
            uint64_t h_19 = __fold_result___6 ^ ((uint64_t)ke_name_0->i ^ 14695981039346656037ULL);
            __fold_result___6 = h_19 * 1099511628211ULL;
            uint64_t h_20 = __fold_result___6 ^ ((uint64_t)ke_name_0->j ^ 14695981039346656037ULL);
            __fold_result___6 = h_20 * 1099511628211ULL;
            FX_CALL(
               _fx_M6K_formFM4add_v3Nt10Hashset__t1R9Ast__id_tR9Ast__id_tq(all_decl_0, ke_name_0,
                  __fold_result___6 & 9223372036854775807ULL, 0), _fx_catch_5);
         }
         FX_BREAK(_fx_catch_5);

      _fx_catch_5: ;
         _fx_free_R17K_form__kdefexn_t(&v_3);
      }
      else if (tag_0 == 34) {
         _fx_R21K_form__kdefvariant_t v_4 = {0};
         _fx_copy_R21K_form__kdefvariant_t(&e_2->u.KDefVariant->data, &v_4);
         _fx_R9Ast__id_t* kvar_name_0 = &v_4.kvar_name;
         if (kvar_name_0->m > 0) {
            FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, kvar_name_0, 0), _fx_catch_6);
         }
         FX_BREAK(_fx_catch_6);

      _fx_catch_6: ;
         _fx_free_R21K_form__kdefvariant_t(&v_4);
      }
      else if (tag_0 == 36) {
         _fx_R17K_form__kdeftyp_t v_5 = {0};
         _fx_copy_R17K_form__kdeftyp_t(&e_2->u.KDefTyp->data, &v_5);
         _fx_R9Ast__id_t* kt_name_0 = &v_5.kt_name;
         if (kt_name_0->m > 0) {
            FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, kt_name_0, 0), _fx_catch_7);
         }
         FX_BREAK(_fx_catch_7);

      _fx_catch_7: ;
         _fx_free_R17K_form__kdeftyp_t(&v_5);
      }
      else if (tag_0 == 26) {
         _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t clauses_0 = 0;
         FX_CALL(_fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_2, &callb_2, 0), _fx_catch_11);
         FX_COPY_PTR(e_2->u.KExpMap.t0, &clauses_0);
         _fx_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t lst_1 = clauses_0;
         for (; lst_1; lst_1 = lst_1->tl) {
            _fx_LT2R9Ast__id_tN13K_form__dom_t id_l_0 = 0;
            _fx_LR9Ast__id_t at_ids_0 = 0;
            _fx_T3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t* __pat___0 = &lst_1->hd;
            FX_COPY_PTR(__pat___0->t1, &id_l_0);
            FX_COPY_PTR(__pat___0->t2, &at_ids_0);
            _fx_LR9Ast__id_t lst_2 = at_ids_0;
            for (; lst_2; lst_2 = lst_2->tl) {
               _fx_R9Ast__id_t* i_0 = &lst_2->hd;
               if (i_0->m > 0) {
                  FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, i_0, 0), _fx_catch_8);
               }

            _fx_catch_8: ;
               FX_CHECK_EXN(_fx_catch_10);
            }
            _fx_LT2R9Ast__id_tN13K_form__dom_t lst_3 = id_l_0;
            for (; lst_3; lst_3 = lst_3->tl) {
               _fx_T2R9Ast__id_tN13K_form__dom_t* __pat___1 = &lst_3->hd;
               _fx_R9Ast__id_t i_1 = __pat___1->t0;
               if (i_1.m > 0) {
                  FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, &i_1, 0), _fx_catch_9);
               }

            _fx_catch_9: ;
               FX_CHECK_EXN(_fx_catch_10);
            }

         _fx_catch_10: ;
            FX_FREE_LIST_SIMPLE(&at_ids_0);
            if (id_l_0) {
               _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&id_l_0);
            }
            FX_CHECK_EXN(_fx_catch_11);
         }
         FX_BREAK(_fx_catch_11);

      _fx_catch_11: ;
         if (clauses_0) {
            _fx_free_LT3N14K_form__kexp_tLT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_t(&clauses_0);
         }
      }
      else if (tag_0 == 27) {
         _fx_LR9Ast__id_t at_ids_1 = 0;
         _fx_LT2R9Ast__id_tN13K_form__dom_t id_l_1 = 0;
         _fx_T5LT2R9Ast__id_tN13K_form__dom_tLR9Ast__id_tN14K_form__kexp_tR16Ast__for_flags_tR10Ast__loc_t* vcase_1 =
            &e_2->u.KExpFor;
         FX_CALL(_fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_2, &callb_2, 0), _fx_catch_14);
         FX_COPY_PTR(vcase_1->t1, &at_ids_1);
         _fx_LR9Ast__id_t lst_4 = at_ids_1;
         for (; lst_4; lst_4 = lst_4->tl) {
            _fx_R9Ast__id_t* i_2 = &lst_4->hd;
            if (i_2->m > 0) {
               FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, i_2, 0), _fx_catch_12);
            }

         _fx_catch_12: ;
            FX_CHECK_EXN(_fx_catch_14);
         }
         FX_COPY_PTR(vcase_1->t0, &id_l_1);
         _fx_LT2R9Ast__id_tN13K_form__dom_t lst_5 = id_l_1;
         for (; lst_5; lst_5 = lst_5->tl) {
            _fx_T2R9Ast__id_tN13K_form__dom_t* __pat___2 = &lst_5->hd;
            _fx_R9Ast__id_t i_3 = __pat___2->t0;
            if (i_3.m > 0) {
               FX_CALL(_fx_M6K_formFM3addv2Nt10Hashset__t1R9Ast__id_tR9Ast__id_t(all_decl_0, &i_3, 0), _fx_catch_13);
            }

         _fx_catch_13: ;
            FX_CHECK_EXN(_fx_catch_14);
         }
         FX_BREAK(_fx_catch_14);

      _fx_catch_14: ;
         if (id_l_1) {
            _fx_free_LT2R9Ast__id_tN13K_form__dom_t(&id_l_1);
         }
         FX_FREE_LIST_SIMPLE(&at_ids_1);
      }
      else {
         FX_CALL(_fx_M6K_formFM9fold_kexpv2N14K_form__kexp_tRM14k_fold_callb_t(e_2, &callb_2, 0), _fx_catch_15);
         FX_BREAK(_fx_catch_15);

      _fx_catch_15: ;
      }
      FX_CHECK_EXN(_fx_catch_16);

   _fx_catch_16: ;
      _fx_free_R22K_form__k_fold_callb_t(&callb_2);
      if (e_2) {
         _fx_free_N14K_form__kexp_t(&e_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }

_fx_cleanup: ;
   if (e_1) {
      _fx_free_N14K_form__kexp_t(&e_1);
   }
   _fx_free_R22K_form__k_fold_callb_t(&callb_1);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9make_fp1_FPv2N14K_form__kexp_tRM14k_fold_callb_t1Nt10Hashset__t1R9Ast__id_t(
   struct _fx_Nt10Hashset__t1R9Ast__id_t_data_t* arg0,
   struct _fx_FPv2N14K_form__kexp_tR22K_form__k_fold_callb_t* fx_result)
{
   FX_MAKE_FP_IMPL_START(_fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t_cldata_t,
      _fx_free_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t,
      _fx_M6K_formFM13decl_by_kexp_v2N14K_form__kexp_tRM14k_fold_callb_t);
   FX_COPY_PTR(arg0, &fcv->t0);
   return 0;
}

FX_EXTERN_C int _fx_M6K_formFM10is_mutableB2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t info_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
   }
   else {
      _fx_Ta2i v_0;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      int_ m_0 = v_0.t0;
      int_ j_0 = v_0.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
   }
   if (info_0.tag == 1) {
      fx_str_t v_1 = {0};
      fx_str_t v_2 = {0};
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
      fx_str_t slit_1 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_1, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
      FX_FREE_STR(&v_2);
      FX_FREE_STR(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   int tag_0 = info_0.tag;
   if (tag_0 == 1) {
      *fx_result = false; goto _fx_endmatch_0;
   }
   if (tag_0 == 2) {
      *fx_result = info_0.u.KVal.kv_flags.val_flag_mutable; goto _fx_endmatch_0;
   }
   if (tag_0 == 3) {
      *fx_result = false; goto _fx_endmatch_0;
   }
   if (tag_0 == 4) {
      *fx_result = false; goto _fx_endmatch_0;
   }
   bool res_0;
   if (tag_0 == 6) {
      res_0 = true;
   }
   else if (tag_0 == 5) {
      res_0 = true;
   }
   else if (tag_0 == 7) {
      res_0 = true;
   }
   else if (tag_0 == 8) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      *fx_result = false; goto _fx_endmatch_0;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&info_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM15is_mutable_atomB2N14K_form__atom_tR10Ast__loc_t(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (a_0->tag == 1) {
      FX_CALL(_fx_M6K_formFM10is_mutableB2R9Ast__id_tR10Ast__loc_t(&a_0->u.AtomId, loc_0, fx_result, 0), _fx_catch_0);

   _fx_catch_0: ;
   }
   else {
      *fx_result = false;
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM11is_subarrayB2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_R10Ast__loc_t* loc_0,
   bool* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t info_0 = {0};
   int fx_status = 0;
   if (n_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &info_0);
   }
   else {
      _fx_Ta2i v_0;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, loc_0, &v_0, 0), _fx_cleanup);
      int_ m_0 = v_0.t0;
      int_ j_0 = v_0.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &info_0);
   }
   if (info_0.tag == 1) {
      fx_str_t v_1 = {0};
      fx_str_t v_2 = {0};
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_1, 0), _fx_catch_0);
      fx_str_t slit_0 = FX_MAKE_STR("attempt to request information about uninitialized symbol \'");
      fx_str_t slit_1 = FX_MAKE_STR("\'");
      {
         const fx_str_t strs_0[] = { slit_0, v_1, slit_1 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_2), _fx_catch_0);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_2, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
      FX_FREE_STR(&v_2);
      FX_FREE_STR(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (info_0.tag == 2) {
      *fx_result = info_0.u.KVal.kv_flags.val_flag_subarray;
   }
   else {
      *fx_result = false;
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&info_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM20get_closure_freevarsT2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t2R9Ast__id_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* f_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t* fx_result,
   void* fx_fv)
{
   _fx_N15K_form__kinfo_t v_0 = {0};
   int fx_status = 0;
   if (f_0->m == 0) {
      _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
   }
   else {
      _fx_Ta2i v_1;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(f_0, loc_0, &v_1, 0), _fx_cleanup);
      int_ m_0 = v_1.t0;
      int_ j_0 = v_1.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
         _fx_cleanup);
      _fx_copy_N15K_form__kinfo_t(
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
   }
   if (v_0.tag == 3) {
      _fx_R17K_form__kdeffun_t v_2 = {0};
      _fx_N15K_form__kinfo_t v_3 = {0};
      _fx_copy_R17K_form__kdeffun_t(&v_0.u.KFun->data, &v_2);
      _fx_R9Ast__id_t* kci_fcv_t_0 = &v_2.kf_closure.kci_fcv_t;
      bool res_0;
      FX_CALL(_fx_M3AstFM6__eq__B2RM4id_tRM4id_t(kci_fcv_t_0, &_fx_g9Ast__noid, &res_0, 0), _fx_catch_1);
      if (res_0) {
         _fx_make_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t(0, 0, fx_result);
      }
      else {
         if (kci_fcv_t_0->m == 0) {
            _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_3);
         }
         else {
            _fx_Ta2i v_4;
            FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(kci_fcv_t_0, loc_0, &v_4, 0), _fx_catch_1);
            int_ m_1 = v_4.t0;
            int_ j_1 = v_4.t1;
            FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_1), _fx_catch_1);
            FX_CHKIDX(
               FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1, 0, j_1),
               _fx_catch_1);
            _fx_copy_N15K_form__kinfo_t(
               FX_PTR_1D(_fx_N15K_form__kinfo_t,
                  (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1, j_1), &v_3);
         }
         if (v_3.tag == 6) {
            _fx_R25K_form__kdefclosurevars_t v_5 = {0};
            _fx_copy_R25K_form__kdefclosurevars_t(&v_3.u.KClosureVars->data, &v_5);
            _fx_make_T2LT2R9Ast__id_tN14K_form__ktyp_tLR9Ast__id_t(v_5.kcv_freevars, v_5.kcv_orig_freevars, fx_result);
            _fx_free_R25K_form__kdefclosurevars_t(&v_5);
         }
         else {
            fx_str_t v_6 = {0};
            fx_str_t v_7 = {0};
            fx_exn_t v_8 = {0};
            FX_CALL(_fx_M3AstFM6stringS1RM4id_t(kci_fcv_t_0, &v_6, 0), _fx_catch_0);
            fx_str_t slit_0 = FX_MAKE_STR("invalid description of a closure data \'");
            fx_str_t slit_1 = FX_MAKE_STR("\' (should KClosureVars ...)");
            {
               const fx_str_t strs_0[] = { slit_0, v_6, slit_1 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_7), _fx_catch_0);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_7, &v_8, 0), _fx_catch_0);
            FX_THROW(&v_8, false, _fx_catch_0);

         _fx_catch_0: ;
            fx_free_exn(&v_8);
            FX_FREE_STR(&v_7);
            FX_FREE_STR(&v_6);
         }
         FX_CHECK_EXN(_fx_catch_1);
      }

   _fx_catch_1: ;
      _fx_free_N15K_form__kinfo_t(&v_3);
      _fx_free_R17K_form__kdeffun_t(&v_2);
   }
   else {
      fx_str_t v_9 = {0};
      fx_str_t v_10 = {0};
      fx_exn_t v_11 = {0};
      FX_CALL(_fx_M3AstFM6stringS1RM4id_t(f_0, &v_9, 0), _fx_catch_2);
      fx_str_t slit_2 = FX_MAKE_STR("get_closure_freevars argument \'");
      fx_str_t slit_3 = FX_MAKE_STR("\' is not a function");
      {
         const fx_str_t strs_1[] = { slit_2, v_9, slit_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, &v_10), _fx_catch_2);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_10, &v_11, 0), _fx_catch_2);
      FX_THROW(&v_11, false, _fx_catch_2);

   _fx_catch_2: ;
      fx_free_exn(&v_11);
      FX_FREE_STR(&v_10);
      FX_FREE_STR(&v_9);
   }

_fx_cleanup: ;
   _fx_free_N15K_form__kinfo_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM10deref_ktypN14K_form__ktyp_t2N14K_form__ktyp_tR10Ast__loc_t(
   struct _fx_N14K_form__ktyp_t_data_t* kt_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_N14K_form__ktyp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N14K_form__ktyp_t result_0 = 0;
   _fx_N14K_form__ktyp_t kt_1 = 0;
   int fx_status = 0;
   FX_COPY_PTR(kt_0, &kt_1);
   _fx_R10Ast__loc_t loc_1 = *loc_0;
   for (;;) {
      _fx_N14K_form__ktyp_t kt_2 = 0;
      FX_COPY_PTR(kt_1, &kt_2);
      _fx_R10Ast__loc_t loc_2 = loc_1;
      if (FX_REC_VARIANT_TAG(kt_2) == 16) {
         _fx_N15K_form__kinfo_t v_0 = {0};
         _fx_R9Ast__id_t* n_0 = &kt_2->u.KTypName;
         if (n_0->m == 0) {
            _fx_copy_N15K_form__kinfo_t(&_fx_g13K_form__KNone, &v_0);
         }
         else {
            _fx_Ta2i v_1;
            FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, &loc_2, &v_1, 0), _fx_catch_3);
            int_ m_0 = v_1.t0;
            int_ j_0 = v_1.t1;
            FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_3);
            FX_CHKIDX(
               FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
               _fx_catch_3);
            _fx_copy_N15K_form__kinfo_t(
               FX_PTR_1D(_fx_N15K_form__kinfo_t,
                  (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_0), &v_0);
         }
         int tag_0 = v_0.tag;
         if (tag_0 == 8) {
            _fx_R17K_form__kdeftyp_t v_2 = {0};
            _fx_copy_R17K_form__kdeftyp_t(&v_0.u.KTyp->data, &v_2);
            _fx_N14K_form__ktyp_t* kt_typ_0 = &v_2.kt_typ;
            _fx_free_N14K_form__ktyp_t(&kt_1);
            FX_COPY_PTR(*kt_typ_0, &kt_1);
            loc_1 = v_2.kt_loc;
            _fx_free_R17K_form__kdeftyp_t(&v_2);
         }
         else if (tag_0 == 5) {
            _fx_free_N14K_form__ktyp_t(&result_0); FX_COPY_PTR(kt_2, &result_0); FX_BREAK(_fx_catch_0);  _fx_catch_0: ;
         }
         else if (tag_0 == 7) {
            _fx_free_N14K_form__ktyp_t(&result_0); FX_COPY_PTR(kt_2, &result_0); FX_BREAK(_fx_catch_1);  _fx_catch_1: ;
         }
         else {
            fx_str_t v_3 = {0};
            fx_str_t v_4 = {0};
            fx_exn_t v_5 = {0};
            FX_CALL(_fx_M3AstFM6stringS1RM4id_t(n_0, &v_3, 0), _fx_catch_2);
            fx_str_t slit_0 = FX_MAKE_STR("named \'type\' \'");
            fx_str_t slit_1 = FX_MAKE_STR("\' does not represent a type");
            {
               const fx_str_t strs_0[] = { slit_0, v_3, slit_1 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, &v_4), _fx_catch_2);
            }
            FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&loc_2, &v_4, &v_5, 0), _fx_catch_2);
            FX_THROW(&v_5, false, _fx_catch_2);

         _fx_catch_2: ;
            fx_free_exn(&v_5);
            FX_FREE_STR(&v_4);
            FX_FREE_STR(&v_3);
         }
         FX_CHECK_EXN(_fx_catch_3);

      _fx_catch_3: ;
         _fx_free_N15K_form__kinfo_t(&v_0);
      }
      else {
         _fx_free_N14K_form__ktyp_t(&result_0); FX_COPY_PTR(kt_2, &result_0); FX_BREAK(_fx_catch_4);  _fx_catch_4: ;
      }
      FX_CHECK_EXN(_fx_catch_5);

   _fx_catch_5: ;
      if (kt_2) {
         _fx_free_N14K_form__ktyp_t(&kt_2);
      }
      FX_CHECK_BREAK();
      FX_CHECK_EXN(_fx_cleanup);
   }
   FX_COPY_PTR(result_0, fx_result);

_fx_cleanup: ;
   if (result_0) {
      _fx_free_N14K_form__ktyp_t(&result_0);
   }
   if (kt_1) {
      _fx_free_N14K_form__ktyp_t(&kt_1);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM14is_ktyp_scalarB1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* ktyp_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = FX_REC_VARIANT_TAG(ktyp_0);
   bool res_0;
   if (tag_0 == 1) {
      res_0 = true;
   }
   else if (tag_0 == 2) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else if (tag_0 == 5) {
      res_0 = true;
   }
   else if (tag_0 == 8) {
      res_0 = true;
   }
   else if (tag_0 == 9) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      *fx_result = true; goto _fx_endmatch_0;
   }
   *fx_result = false;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM15is_ktyp_integerB2N14K_form__ktyp_tB(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   bool allow_bool_0,
   bool* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = FX_REC_VARIANT_TAG(t_0);
   bool res_0;
   if (tag_0 == 2) {
      res_0 = true;
   }
   else if (tag_0 == 1) {
      res_0 = true;
   }
   else if (tag_0 == 3) {
      res_0 = true;
   }
   else if (tag_0 == 4) {
      res_0 = true;
   }
   else {
      res_0 = false;
   }
   FX_CHECK_EXN(_fx_cleanup);
   if (res_0) {
      *fx_result = true; goto _fx_endmatch_0;
   }
   if (tag_0 == 8) {
      *fx_result = allow_bool_0; goto _fx_endmatch_0;
   }
   *fx_result = false;

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6K_formFM14create_kdefvalLN14K_form__kexp_t6R9Ast__id_tN14K_form__ktyp_tR16Ast__val_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_N14K_form__ktyp_t_data_t* ktyp_0,
   struct _fx_R16Ast__val_flags_t* flags_0,
   struct _fx_Nt6option1N14K_form__kexp_t* e_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_R17K_form__kdefval_t dv_0 = {0};
   _fx_N15K_form__kinfo_t v_0 = {0};
   int fx_status = 0;
   fx_str_t slit_0 = FX_MAKE_STR("");
   _fx_make_R17K_form__kdefval_t(n_0, &slit_0, ktyp_0, flags_0, loc_0, &dv_0);
   if (FX_REC_VARIANT_TAG(ktyp_0) == 7) {
      fx_exn_t v_1 = {0};
      fx_str_t slit_1 = FX_MAKE_STR("values of \'void\' type are not allowed");
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_1, &v_1, 0), _fx_catch_0);
      FX_THROW(&v_1, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_1);
   }
   FX_CHECK_EXN(_fx_cleanup);
   _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&dv_0, &v_0);
   _fx_Ta2i v_2;
   FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, &_fx_g10Ast__noloc, &v_2, 0), _fx_cleanup);
   int_ m_0 = v_2.t0;
   int_ j_0 = v_2.t1;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
   FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
      _fx_cleanup);
   _fx_N15K_form__kinfo_t* v_3 =
      FX_PTR_1D(_fx_N15K_form__kinfo_t, (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1,
         j_0);
   _fx_free_N15K_form__kinfo_t(v_3);
   _fx_copy_N15K_form__kinfo_t(&v_0, v_3);
   if (e_opt_0->tag == 2) {
      _fx_N14K_form__kexp_t v_4 = 0;
      FX_CALL(
         _fx_M6K_formFM7KDefValN14K_form__kexp_t3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(n_0, e_opt_0->u.Some, loc_0, &v_4),
         _fx_catch_1);
      FX_CALL(_fx_cons_LN14K_form__kexp_t(v_4, code_0, true, fx_result), _fx_catch_1);

   _fx_catch_1: ;
      if (v_4) {
         _fx_free_N14K_form__kexp_t(&v_4);
      }
   }
   else {
      FX_COPY_PTR(code_0, fx_result);
   }

_fx_cleanup: ;
   _fx_free_R17K_form__kdefval_t(&dv_0);
   _fx_free_N15K_form__kinfo_t(&v_0);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(
   int_ m_idx_0,
   fx_str_t* prefix_0,
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   bool tref_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_T2N14K_form__atom_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   if (FX_REC_VARIANT_TAG(e_0) == 5) {
      _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&e_0->u.KExpAtom.t0, code_0, fx_result);
   }
   else {
      _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_0 = {0};
      _fx_N14K_form__ktyp_t ktyp_0 = 0;
      _fx_R16Ast__val_flags_t v_1 = {0};
      _fx_R16Ast__val_flags_t v_2 = {0};
      _fx_Nt6option1N14K_form__kexp_t v_3 = {0};
      _fx_R17K_form__kdefval_t dv_0 = {0};
      _fx_N15K_form__kinfo_t v_4 = {0};
      _fx_LN14K_form__kexp_t code_1 = 0;
      _fx_N14K_form__atom_t v_5 = {0};
      int_ i_0;
      FX_CALL(_fx_M3AstFM13get_id_prefixi1S(prefix_0, &i_0, 0), _fx_catch_3);
      int_ j_0;
      FX_CALL(_fx_M6K_formFM11new_idk_idxi1i(m_idx_0, &j_0, 0), _fx_catch_3);
      _fx_R9Ast__id_t tmp_id_0 = { m_idx_0, i_0, j_0 };
      FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(e_0, &v_0, 0), _fx_catch_3);
      FX_COPY_PTR(v_0.t0, &ktyp_0);
      _fx_R10Ast__loc_t kloc_0 = v_0.t1;
      if (FX_REC_VARIANT_TAG(ktyp_0) == 7) {
         fx_exn_t v_6 = {0};
         fx_str_t slit_0 = FX_MAKE_STR("\'void\' expression or declaration cannot be converted to an atom");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&kloc_0, &slit_0, &v_6, 0), _fx_catch_0);
         FX_THROW(&v_6, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_6);
      }
      FX_CHECK_EXN(_fx_catch_3);
      int tag_0 = FX_REC_VARIANT_TAG(e_0);
      bool tref_1;
      bool res_0;
      if (tag_0 == 20) {
         res_0 = true; goto _fx_endmatch_0;
      }
      if (tag_0 == 19) {
         _fx_T5N14K_form__atom_tN13Ast__border_tN18Ast__interpolate_tLN13K_form__dom_tT2N14K_form__ktyp_tR10Ast__loc_t*
            vcase_0 = &e_0->u.KExpAt;
         if (vcase_0->t1.tag == 1) {
            if (vcase_0->t2.tag == 1) {
               res_0 = true; goto _fx_endmatch_0;
            }
         }
      }
      if (tag_0 == 7) {
         if (e_0->u.KExpUnary.t0.tag == 7) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      if (tag_0 == 8) {
         if (e_0->u.KExpIntrin.t0.tag == 3) {
            res_0 = true; goto _fx_endmatch_0;
         }
      }
      res_0 = false;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_3);
      if (res_0) {
         tref_1 = tref_0; goto _fx_endmatch_1;
      }
      tref_1 = false;

   _fx_endmatch_1: ;
      FX_CHECK_EXN(_fx_catch_3);
      FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_1, 0), _fx_catch_3);
      _fx_make_R16Ast__val_flags_t(v_1.val_flag_arg, v_1.val_flag_mutable, !tref_1, tref_1, v_1.val_flag_private,
         v_1.val_flag_subarray, v_1.val_flag_instance, &v_1.val_flag_method, v_1.val_flag_ctor, v_1.val_flag_global, &v_2);
      _fx_M6K_formFM4SomeNt6option1N14K_form__kexp_t1N14K_form__kexp_t(e_0, &v_3);
      fx_str_t slit_1 = FX_MAKE_STR("");
      _fx_make_R17K_form__kdefval_t(&tmp_id_0, &slit_1, ktyp_0, &v_2, &kloc_0, &dv_0);
      if (FX_REC_VARIANT_TAG(ktyp_0) == 7) {
         fx_exn_t v_7 = {0};
         fx_str_t slit_2 = FX_MAKE_STR("values of \'void\' type are not allowed");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&kloc_0, &slit_2, &v_7, 0), _fx_catch_1);
         FX_THROW(&v_7, false, _fx_catch_1);

      _fx_catch_1: ;
         fx_free_exn(&v_7);
      }
      FX_CHECK_EXN(_fx_catch_3);
      _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&dv_0, &v_4);
      _fx_Ta2i v_8;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(&tmp_id_0, &_fx_g10Ast__noloc, &v_8, 0), _fx_catch_3);
      int_ m_0 = v_8.t0;
      int_ j_1 = v_8.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_3);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_1),
         _fx_catch_3);
      _fx_N15K_form__kinfo_t* v_9 =
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_1);
      _fx_free_N15K_form__kinfo_t(v_9);
      _fx_copy_N15K_form__kinfo_t(&v_4, v_9);
      if (v_3.tag == 2) {
         _fx_N14K_form__kexp_t v_10 = 0;
         FX_CALL(
            _fx_M6K_formFM7KDefValN14K_form__kexp_t3R9Ast__id_tN14K_form__kexp_tR10Ast__loc_t(&tmp_id_0, v_3.u.Some, &kloc_0,
               &v_10), _fx_catch_2);
         FX_CALL(_fx_cons_LN14K_form__kexp_t(v_10, code_0, true, &code_1), _fx_catch_2);

      _fx_catch_2: ;
         if (v_10) {
            _fx_free_N14K_form__kexp_t(&v_10);
         }
      }
      else {
         FX_COPY_PTR(code_0, &code_1);
      }
      FX_CHECK_EXN(_fx_catch_3);
      _fx_M6K_formFM6AtomIdN14K_form__atom_t1R9Ast__id_t(&tmp_id_0, &v_5);
      _fx_make_T2N14K_form__atom_tLN14K_form__kexp_t(&v_5, code_1, fx_result);

   _fx_catch_3: ;
      _fx_free_N14K_form__atom_t(&v_5);
      if (code_1) {
         _fx_free_LN14K_form__kexp_t(&code_1);
      }
      _fx_free_N15K_form__kinfo_t(&v_4);
      _fx_free_R17K_form__kdefval_t(&dv_0);
      _fx_free_Nt6option1N14K_form__kexp_t(&v_3);
      _fx_free_R16Ast__val_flags_t(&v_2);
      _fx_free_R16Ast__val_flags_t(&v_1);
      if (ktyp_0) {
         _fx_free_N14K_form__ktyp_t(&ktyp_0);
      }
      _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_0);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7atom2idR9Ast__id_t3N14K_form__atom_tR10Ast__loc_tS(
   struct _fx_N14K_form__atom_t* a_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* msg_0,
   struct _fx_R9Ast__id_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = a_0->tag;
   if (tag_0 == 1) {
      *fx_result = a_0->u.AtomId;
   }
   else if (tag_0 == 2) {
      fx_exn_t v_0 = {0};
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, msg_0, &v_0, 0), _fx_catch_0);
      FX_THROW(&v_0, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_0);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7kexp2idT2R9Ast__id_tLN14K_form__kexp_t6iSN14K_form__kexp_tBLN14K_form__kexp_tS(
   int_ m_idx_0,
   fx_str_t* prefix_0,
   struct _fx_N14K_form__kexp_t_data_t* e_0,
   bool tref_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   fx_str_t* msg_0,
   struct _fx_T2R9Ast__id_tLN14K_form__kexp_t* fx_result,
   void* fx_fv)
{
   _fx_T2N14K_form__atom_tLN14K_form__kexp_t v_0 = {0};
   _fx_N14K_form__atom_t a_0 = {0};
   _fx_LN14K_form__kexp_t code_1 = 0;
   _fx_T2N14K_form__ktyp_tR10Ast__loc_t v_1 = {0};
   int fx_status = 0;
   FX_CALL(
      _fx_M6K_formFM9kexp2atomT2N14K_form__atom_tLN14K_form__kexp_t5iSN14K_form__kexp_tBLN14K_form__kexp_t(m_idx_0, prefix_0,
         e_0, tref_0, code_0, &v_0, 0), _fx_cleanup);
   _fx_copy_N14K_form__atom_t(&v_0.t0, &a_0);
   FX_COPY_PTR(v_0.t1, &code_1);
   FX_CALL(_fx_M6K_formFM12get_kexp_ctxT2N14K_form__ktyp_tR10Ast__loc_t1N14K_form__kexp_t(e_0, &v_1, 0), _fx_cleanup);
   _fx_R10Ast__loc_t v_2 = v_1.t1;
   int tag_0 = a_0.tag;
   _fx_R9Ast__id_t i_0;
   if (tag_0 == 1) {
      i_0 = a_0.u.AtomId;
   }
   else if (tag_0 == 2) {
      fx_exn_t v_3 = {0};
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&v_2, msg_0, &v_3, 0), _fx_catch_0);
      FX_THROW(&v_3, false, _fx_catch_0);

   _fx_catch_0: ;
      fx_free_exn(&v_3);
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }
   FX_CHECK_EXN(_fx_cleanup);
   _fx_make_T2R9Ast__id_tLN14K_form__kexp_t(&i_0, code_1, fx_result);

_fx_cleanup: ;
   _fx_free_T2N14K_form__atom_tLN14K_form__kexp_t(&v_0);
   _fx_free_N14K_form__atom_t(&a_0);
   if (code_1) {
      _fx_free_LN14K_form__kexp_t(&code_1);
   }
   _fx_free_T2N14K_form__ktyp_tR10Ast__loc_t(&v_1);
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6K_formFM14create_kdeffunLN14K_form__kexp_t8R9Ast__id_tLR9Ast__id_tN14K_form__ktyp_tR16Ast__fun_flags_tNt6option1N14K_form__kexp_tLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_LR9Ast__id_t_data_t* params_0,
   struct _fx_N14K_form__ktyp_t_data_t* rt_0,
   struct _fx_R16Ast__fun_flags_t* flags_0,
   struct _fx_Nt6option1N14K_form__kexp_t* body_opt_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_N14K_form__kexp_t body_0 = 0;
   _fx_R17K_form__kdeffun_t v_0 = {0};
   _fx_rR17K_form__kdeffun_t kf_0 = 0;
   _fx_N15K_form__kinfo_t v_1 = {0};
   _fx_N14K_form__kexp_t v_2 = 0;
   int fx_status = 0;
   if (body_opt_0->tag == 2) {
      FX_COPY_PTR(body_opt_0->u.Some, &body_0);
   }
   else {
      FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(loc_0, &body_0), _fx_catch_0);  _fx_catch_0: ;
   }
   FX_CHECK_EXN(_fx_cleanup);
   _fx_R25K_form__kdefclosureinfo_t v_3 = { _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid
      };
   fx_str_t slit_0 = FX_MAKE_STR("");
   _fx_make_R17K_form__kdeffun_t(n_0, &slit_0, params_0, rt_0, body_0, flags_0, &v_3, sc_0, loc_0, &v_0);
   FX_CALL(_fx_make_rR17K_form__kdeffun_t(&v_0, &kf_0), _fx_cleanup);
   _fx_M6K_formFM4KFunN15K_form__kinfo_t1rRM9kdeffun_t(kf_0, &v_1);
   _fx_Ta2i v_4;
   FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, &_fx_g10Ast__noloc, &v_4, 0), _fx_cleanup);
   int_ m_0 = v_4.t0;
   int_ j_0 = v_4.t1;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_cleanup);
   FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_0),
      _fx_cleanup);
   _fx_N15K_form__kinfo_t* v_5 =
      FX_PTR_1D(_fx_N15K_form__kinfo_t, (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1,
         j_0);
   _fx_free_N15K_form__kinfo_t(v_5);
   _fx_copy_N15K_form__kinfo_t(&v_1, v_5);
   FX_CALL(_fx_M6K_formFM7KDefFunN14K_form__kexp_t1rRM9kdeffun_t(kf_0, &v_2), _fx_cleanup);
   FX_CALL(_fx_cons_LN14K_form__kexp_t(v_2, code_0, true, fx_result), _fx_cleanup);

_fx_cleanup: ;
   if (body_0) {
      _fx_free_N14K_form__kexp_t(&body_0);
   }
   _fx_free_R17K_form__kdeffun_t(&v_0);
   if (kf_0) {
      _fx_free_rR17K_form__kdeffun_t(&kf_0);
   }
   _fx_free_N15K_form__kinfo_t(&v_1);
   if (v_2) {
      _fx_free_N14K_form__kexp_t(&v_2);
   }
   return fx_status;
}

FX_EXTERN_C int
   _fx_M6K_formFM17create_kdefconstrLN14K_form__kexp_t8R9Ast__id_tLN14K_form__ktyp_tN14K_form__ktyp_tN17Ast__fun_constr_tBLN14K_form__kexp_tLN12Ast__scope_tR10Ast__loc_t(
   struct _fx_R9Ast__id_t* n_0,
   struct _fx_LN14K_form__ktyp_t_data_t* paramtyps_0,
   struct _fx_N14K_form__ktyp_t_data_t* rt_0,
   struct _fx_N17Ast__fun_constr_t* ctor_0,
   bool isinstance_0,
   struct _fx_LN14K_form__kexp_t_data_t* code_0,
   struct _fx_LN12Ast__scope_t_data_t* sc_0,
   struct _fx_R10Ast__loc_t* loc_0,
   struct _fx_LN14K_form__kexp_t_data_t** fx_result,
   void* fx_fv)
{
   _fx_LR9Ast__id_t params_0 = 0;
   _fx_N14K_form__kexp_t body_0 = 0;
   _fx_R17K_form__kdeffun_t v_0 = {0};
   _fx_rR17K_form__kdeffun_t kf_0 = 0;
   _fx_N15K_form__kinfo_t v_1 = {0};
   _fx_N14K_form__kexp_t v_2 = 0;
   int fx_status = 0;
   int_ km_idx_0;
   FX_CALL(_fx_M3AstFM11curr_modulei1LN12Ast__scope_t(sc_0, &km_idx_0, 0), _fx_cleanup);
   _fx_LR9Ast__id_t lstend_0 = 0;
   int_ idx_0 = 0;
   _fx_LN14K_form__ktyp_t lst_0 = paramtyps_0;
   for (; lst_0; lst_0 = lst_0->tl, idx_0 += 1) {
      fx_str_t v_3 = {0};
      fx_str_t v_4 = {0};
      _fx_R16Ast__val_flags_t v_5 = {0};
      _fx_R16Ast__val_flags_t v_6 = {0};
      _fx_R17K_form__kdefval_t dv_0 = {0};
      _fx_N15K_form__kinfo_t v_7 = {0};
      _fx_N14K_form__ktyp_t t_0 = lst_0->hd;
      FX_CALL(_fx_F6stringS1i(idx_0, &v_3, 0), _fx_catch_1);
      fx_str_t slit_0 = FX_MAKE_STR("arg");
      {
         const fx_str_t strs_0[] = { slit_0, v_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 2, &v_4), _fx_catch_1);
      }
      int_ i_0;
      FX_CALL(_fx_M3AstFM13get_id_prefixi1S(&v_4, &i_0, 0), _fx_catch_1);
      int_ j_0;
      FX_CALL(_fx_M6K_formFM11new_idk_idxi1i(km_idx_0, &j_0, 0), _fx_catch_1);
      _fx_R9Ast__id_t p_0 = { km_idx_0, i_0, j_0 };
      FX_CALL(_fx_M3AstFM17default_val_flagsRM11val_flags_t0(&v_5, 0), _fx_catch_1);
      _fx_make_R16Ast__val_flags_t(true, v_5.val_flag_mutable, v_5.val_flag_temp, v_5.val_flag_tempref, v_5.val_flag_private,
         v_5.val_flag_subarray, v_5.val_flag_instance, &v_5.val_flag_method, v_5.val_flag_ctor, v_5.val_flag_global, &v_6);
      fx_str_t slit_1 = FX_MAKE_STR("");
      _fx_make_R17K_form__kdefval_t(&p_0, &slit_1, t_0, &v_6, loc_0, &dv_0);
      if (FX_REC_VARIANT_TAG(t_0) == 7) {
         fx_exn_t v_8 = {0};
         fx_str_t slit_2 = FX_MAKE_STR("values of \'void\' type are not allowed");
         FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &slit_2, &v_8, 0), _fx_catch_0);
         FX_THROW(&v_8, false, _fx_catch_0);

      _fx_catch_0: ;
         fx_free_exn(&v_8);
      }
      FX_CHECK_EXN(_fx_catch_1);
      _fx_M6K_formFM4KValN15K_form__kinfo_t1RM9kdefval_t(&dv_0, &v_7);
      _fx_Ta2i v_9;
      FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(&p_0, &_fx_g10Ast__noloc, &v_9, 0), _fx_catch_1);
      int_ m_0 = v_9.t0;
      int_ j_1 = v_9.t1;
      FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_0), _fx_catch_1);
      FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, 0, j_1),
         _fx_catch_1);
      _fx_N15K_form__kinfo_t* v_10 =
         FX_PTR_1D(_fx_N15K_form__kinfo_t,
            (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_0))->u.t.t1, j_1);
      _fx_free_N15K_form__kinfo_t(v_10);
      _fx_copy_N15K_form__kinfo_t(&v_7, v_10);
      _fx_LR9Ast__id_t node_0 = 0;
      FX_CALL(_fx_cons_LR9Ast__id_t(&p_0, 0, false, &node_0), _fx_catch_1);
      FX_LIST_APPEND(params_0, lstend_0, node_0);

   _fx_catch_1: ;
      _fx_free_N15K_form__kinfo_t(&v_7);
      _fx_free_R17K_form__kdefval_t(&dv_0);
      _fx_free_R16Ast__val_flags_t(&v_6);
      _fx_free_R16Ast__val_flags_t(&v_5);
      FX_FREE_STR(&v_4);
      FX_FREE_STR(&v_3);
      FX_CHECK_EXN(_fx_cleanup);
   }
   _fx_R16Ast__fun_flags_t v_11;
   FX_CALL(_fx_M3AstFM17default_fun_flagsRM11fun_flags_t0(&v_11, 0), _fx_cleanup);
   _fx_R16Ast__fun_flags_t v_12 =
      { v_11.fun_flag_pure, v_11.fun_flag_ccode, v_11.fun_flag_have_keywords, v_11.fun_flag_inline, v_11.fun_flag_nothrow,
         v_11.fun_flag_really_nothrow, v_11.fun_flag_private, *ctor_0, v_11.fun_flag_method_of, v_11.fun_flag_uses_fv,
         v_11.fun_flag_recursive, isinstance_0 };
   FX_CALL(_fx_M6K_formFM7KExpNopN14K_form__kexp_t1R10Ast__loc_t(loc_0, &body_0), _fx_cleanup);
   _fx_R25K_form__kdefclosureinfo_t v_13 = { _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid, _fx_g9Ast__noid
      };
   fx_str_t slit_3 = FX_MAKE_STR("");
   _fx_make_R17K_form__kdeffun_t(n_0, &slit_3, params_0, rt_0, body_0, &v_12, &v_13, sc_0, loc_0, &v_0);
   FX_CALL(_fx_make_rR17K_form__kdeffun_t(&v_0, &kf_0), _fx_cleanup);
   _fx_M6K_formFM4KFunN15K_form__kinfo_t1rRM9kdeffun_t(kf_0, &v_1);
   _fx_Ta2i v_14;
   FX_CALL(_fx_M3AstFM7id2idx_Ta2i2RM4id_tRM5loc_t(n_0, &_fx_g10Ast__noloc, &v_14, 0), _fx_cleanup);
   int_ m_1 = v_14.t0;
   int_ j_2 = v_14.t1;
   FX_CHKIDX(FX_CHKIDX1(_fx_g16K_form__all_idks, 0, m_1), _fx_cleanup);
   FX_CHKIDX(FX_CHKIDX1((*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1, 0, j_2),
      _fx_cleanup);
   _fx_N15K_form__kinfo_t* v_15 =
      FX_PTR_1D(_fx_N15K_form__kinfo_t, (*FX_PTR_1D(_fx_Nt9Dynvec__t1N15K_form__kinfo_t, _fx_g16K_form__all_idks, m_1))->u.t.t1,
         j_2);
   _fx_free_N15K_form__kinfo_t(v_15);
   _fx_copy_N15K_form__kinfo_t(&v_1, v_15);
   FX_CALL(_fx_M6K_formFM7KDefFunN14K_form__kexp_t1rRM9kdeffun_t(kf_0, &v_2), _fx_cleanup);
   FX_CALL(_fx_cons_LN14K_form__kexp_t(v_2, code_0, true, fx_result), _fx_cleanup);

_fx_cleanup: ;
   FX_FREE_LIST_SIMPLE(&params_0);
   if (body_0) {
      _fx_free_N14K_form__kexp_t(&body_0);
   }
   _fx_free_R17K_form__kdeffun_t(&v_0);
   if (kf_0) {
      _fx_free_rR17K_form__kdeffun_t(&kf_0);
   }
   _fx_free_N15K_form__kinfo_t(&v_1);
   if (v_2) {
      _fx_free_N14K_form__kexp_t(&v_2);
   }
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   bool nf_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   int tag_0 = FX_REC_VARIANT_TAG(t_0);
   if (tag_0 == 1) {
      fx_str_t slit_0 = FX_MAKE_STR("int"); fx_copy_str(&slit_0, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 2) {
      fx_str_t slit_1 = FX_MAKE_STR("int32_t"); fx_copy_str(&slit_1, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 3) {
      fx_str_t v_0 = {0};
      FX_CALL(_fx_F6stringS1i(t_0->u.KTypSInt, &v_0, 0), _fx_catch_0);
      fx_str_t slit_2 = FX_MAKE_STR("int");
      fx_str_t slit_3 = FX_MAKE_STR("_t");
      {
         const fx_str_t strs_0[] = { slit_2, v_0, slit_3 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_0, 3, fx_result), _fx_catch_0);
      }

   _fx_catch_0: ;
      FX_FREE_STR(&v_0);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 4) {
      fx_str_t v_1 = {0};
      FX_CALL(_fx_F6stringS1i(t_0->u.KTypUInt, &v_1, 0), _fx_catch_1);
      fx_str_t slit_4 = FX_MAKE_STR("uint");
      fx_str_t slit_5 = FX_MAKE_STR("_t");
      {
         const fx_str_t strs_1[] = { slit_4, v_1, slit_5 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, fx_result), _fx_catch_1);
      }

   _fx_catch_1: ;
      FX_FREE_STR(&v_1);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 6) {
      fx_str_t slit_6 = FX_MAKE_STR("long"); fx_copy_str(&slit_6, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 5) {
      if (t_0->u.KTypFloat == 16) {
         fx_str_t slit_7 = FX_MAKE_STR("half"); fx_copy_str(&slit_7, fx_result); goto _fx_endmatch_1;
      }
   }
   if (tag_0 == 5) {
      if (t_0->u.KTypFloat == 32) {
         fx_str_t slit_8 = FX_MAKE_STR("float"); fx_copy_str(&slit_8, fx_result); goto _fx_endmatch_1;
      }
   }
   if (tag_0 == 5) {
      if (t_0->u.KTypFloat == 64) {
         fx_str_t slit_9 = FX_MAKE_STR("double"); fx_copy_str(&slit_9, fx_result); goto _fx_endmatch_1;
      }
   }
   if (tag_0 == 5) {
      fx_str_t v_2 = {0};
      fx_str_t v_3 = {0};
      fx_exn_t v_4 = {0};
      FX_CALL(_fx_F6stringS1i(t_0->u.KTypFloat, &v_2, 0), _fx_catch_2);
      fx_str_t slit_10 = FX_MAKE_STR("unsupported ");
      fx_str_t slit_11 = FX_MAKE_STR("-bit floating-point type");
      {
         const fx_str_t strs_2[] = { slit_10, v_2, slit_11 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_2, 3, &v_3), _fx_catch_2);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(&_fx_g10Ast__noloc, &v_3, &v_4, 0), _fx_catch_2);
      FX_THROW(&v_4, false, _fx_catch_2);

   _fx_catch_2: ;
      fx_free_exn(&v_4);
      FX_FREE_STR(&v_3);
      FX_FREE_STR(&v_2);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 7) {
      fx_str_t slit_12 = FX_MAKE_STR("void"); fx_copy_str(&slit_12, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 8) {
      fx_str_t slit_13 = FX_MAKE_STR("bool"); fx_copy_str(&slit_13, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 9) {
      fx_str_t slit_14 = FX_MAKE_STR("char"); fx_copy_str(&slit_14, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 10) {
      fx_str_t slit_15 = FX_MAKE_STR("string"); fx_copy_str(&slit_15, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 11) {
      fx_str_t slit_16 = FX_MAKE_STR("cptr"); fx_copy_str(&slit_16, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 12) {
      fx_str_t v_5 = {0};
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(t_0->u.KTypRawPointer, true, &v_5, 0), _fx_catch_3);
      fx_str_t slit_17 = FX_MAKE_STR("*");
      {
         const fx_str_t strs_3[] = { v_5, slit_17 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_3, 2, fx_result), _fx_catch_3);
      }

   _fx_catch_3: ;
      FX_FREE_STR(&v_5);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 13) {
      fx_str_t argtyps_str_0 = {0};
      fx_str_t rt_str_0 = {0};
      _fx_T2LN14K_form__ktyp_tN14K_form__ktyp_t* vcase_0 = &t_0->u.KTypFun;
      _fx_LN14K_form__ktyp_t argtyps_0 = vcase_0->t0;
      if (argtyps_0 == 0) {
         fx_str_t slit_18 = FX_MAKE_STR("void"); fx_copy_str(&slit_18, &argtyps_str_0); goto _fx_endmatch_0;
      }
      if (argtyps_0 != 0) {
         if (argtyps_0->tl == 0) {
            FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(argtyps_0->hd, true, &argtyps_str_0, 0), _fx_catch_4);

         _fx_catch_4: ;
            goto _fx_endmatch_0;
         }
      }
      FX_CALL(_fx_M6K_formFM7ktl2strS1LN14K_form__ktyp_t(argtyps_0, &argtyps_str_0, 0), _fx_catch_5);

   _fx_catch_5: ;

   _fx_endmatch_0: ;
      FX_CHECK_EXN(_fx_catch_6);
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(vcase_0->t1, true, &rt_str_0, 0), _fx_catch_6);
      if (nf_0) {
         fx_str_t slit_19 = FX_MAKE_STR("(");
         fx_str_t slit_20 = FX_MAKE_STR(" -> ");
         fx_str_t slit_21 = FX_MAKE_STR(")");
         {
            const fx_str_t strs_4[] = { slit_19, argtyps_str_0, slit_20, rt_str_0, slit_21 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_4, 5, fx_result), _fx_catch_6);
         }
      }
      else {
         fx_str_t slit_22 = FX_MAKE_STR(" -> ");
         {
            const fx_str_t strs_5[] = { argtyps_str_0, slit_22, rt_str_0 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_5, 3, fx_result), _fx_catch_6);
         }
      }

   _fx_catch_6: ;
      FX_FREE_STR(&rt_str_0);
      FX_FREE_STR(&argtyps_str_0);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 14) {
      FX_CALL(_fx_M6K_formFM7ktl2strS1LN14K_form__ktyp_t(t_0->u.KTypTuple, fx_result, 0), _fx_catch_7);

   _fx_catch_7: ;
      goto _fx_endmatch_1;
   }
   if (tag_0 == 15) {
      fx_str_t v_6 = {0};
      FX_CALL(_fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(&t_0->u.KTypRecord.t0, &_fx_g10Ast__noloc, &v_6, 0),
         _fx_catch_8);
      fx_str_t slit_23 = FX_MAKE_STR(" {...}");
      {
         const fx_str_t strs_6[] = { v_6, slit_23 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_6, 2, fx_result), _fx_catch_8);
      }

   _fx_catch_8: ;
      FX_FREE_STR(&v_6);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 16) {
      FX_CALL(_fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(&t_0->u.KTypName, &_fx_g10Ast__noloc, fx_result, 0),
         _fx_catch_9);

   _fx_catch_9: ;
      goto _fx_endmatch_1;
   }
   if (tag_0 == 17) {
      fx_str_t commas_0 = {0};
      fx_str_t v_7 = {0};
      _fx_T2iN14K_form__ktyp_t* vcase_1 = &t_0->u.KTypArray;
      FX_CALL(_fx_F7__mul__S2Ci((char_)44, vcase_1->t0 - 1, &commas_0, 0), _fx_catch_10);
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(vcase_1->t1, true, &v_7, 0), _fx_catch_10);
      fx_str_t slit_24 = FX_MAKE_STR(" [");
      fx_str_t slit_25 = FX_MAKE_STR("]");
      {
         const fx_str_t strs_7[] = { v_7, slit_24, commas_0, slit_25 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_7, 4, fx_result), _fx_catch_10);
      }

   _fx_catch_10: ;
      FX_FREE_STR(&v_7);
      FX_FREE_STR(&commas_0);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 18) {
      fx_str_t v_8 = {0};
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(t_0->u.KTypVector, true, &v_8, 0), _fx_catch_11);
      fx_str_t slit_26 = FX_MAKE_STR(" vector");
      {
         const fx_str_t strs_8[] = { v_8, slit_26 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_8, 2, fx_result), _fx_catch_11);
      }

   _fx_catch_11: ;
      FX_FREE_STR(&v_8);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 19) {
      fx_str_t v_9 = {0};
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(t_0->u.KTypList, true, &v_9, 0), _fx_catch_12);
      fx_str_t slit_27 = FX_MAKE_STR(" list");
      {
         const fx_str_t strs_9[] = { v_9, slit_27 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_9, 2, fx_result), _fx_catch_12);
      }

   _fx_catch_12: ;
      FX_FREE_STR(&v_9);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 20) {
      fx_str_t v_10 = {0};
      FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(t_0->u.KTypRef, true, &v_10, 0), _fx_catch_13);
      fx_str_t slit_28 = FX_MAKE_STR(" ref");
      {
         const fx_str_t strs_10[] = { v_10, slit_28 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_10, 2, fx_result), _fx_catch_13);
      }

   _fx_catch_13: ;
      FX_FREE_STR(&v_10);
      goto _fx_endmatch_1;
   }
   if (tag_0 == 21) {
      fx_str_t slit_29 = FX_MAKE_STR("exn"); fx_copy_str(&slit_29, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 22) {
      fx_str_t slit_30 = FX_MAKE_STR("<err>"); fx_copy_str(&slit_30, fx_result); goto _fx_endmatch_1;
   }
   if (tag_0 == 23) {
      fx_str_t slit_31 = FX_MAKE_STR("<module>"); fx_copy_str(&slit_31, fx_result); goto _fx_endmatch_1;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_1: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM6stringS1N14K_form__ktyp_t(
   struct _fx_N14K_form__ktyp_t_data_t* t_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   FX_CALL(_fx_M6K_formFM9ktyp2str_S2N14K_form__ktyp_tB(t_0, false, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM8klit2strS3N14K_form__klit_tBR10Ast__loc_t(
   struct _fx_N14K_form__klit_t* lit_0,
   bool cmode_0,
   struct _fx_R10Ast__loc_t* loc_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = lit_0->tag;
   if (tag_0 == 1) {
      FX_CALL(_fx_F6stringS1l(lit_0->u.KLitInt, fx_result, 0), _fx_catch_0);  _fx_catch_0: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 2) {
      _fx_T2il* vcase_0 = &lit_0->u.KLitSInt;
      if (vcase_0->t0 == 64) {
         fx_str_t v_0 = {0};
         fx_str_t v_1 = {0};
         fx_str_t v_2 = {0};
         int64_t v_3 = vcase_0->t1;
         if (cmode_0) {
            FX_CALL(_fx_F6stringS1l(v_3, &v_0, 0), _fx_catch_1);
            fx_str_t slit_0 = FX_MAKE_STR("LL");
            {
               const fx_str_t strs_0[] = { v_0, slit_0 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_0, 2, fx_result), _fx_catch_1);
            }
         }
         else {
            FX_CALL(_fx_F6stringS1l(v_3, &v_1, 0), _fx_catch_1);
            FX_CALL(_fx_F6stringS1i(64, &v_2, 0), _fx_catch_1);
            fx_str_t slit_1 = FX_MAKE_STR("i");
            {
               const fx_str_t strs_1[] = { v_1, slit_1, v_2 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_1, 3, fx_result), _fx_catch_1);
            }
         }

      _fx_catch_1: ;
         FX_FREE_STR(&v_2);
         FX_FREE_STR(&v_1);
         FX_FREE_STR(&v_0);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 3) {
      _fx_T2iq* vcase_1 = &lit_0->u.KLitUInt;
      if (vcase_1->t0 == 64) {
         fx_str_t v_4 = {0};
         fx_str_t v_5 = {0};
         fx_str_t v_6 = {0};
         uint64_t v_7 = vcase_1->t1;
         if (cmode_0) {
            FX_CALL(_fx_F6stringS1q(v_7, &v_4, 0), _fx_catch_2);
            fx_str_t slit_2 = FX_MAKE_STR("ULL");
            {
               const fx_str_t strs_2[] = { v_4, slit_2 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_2, 2, fx_result), _fx_catch_2);
            }
         }
         else {
            FX_CALL(_fx_F6stringS1q(v_7, &v_5, 0), _fx_catch_2);
            FX_CALL(_fx_F6stringS1i(64, &v_6, 0), _fx_catch_2);
            fx_str_t slit_3 = FX_MAKE_STR("i");
            {
               const fx_str_t strs_3[] = { v_5, slit_3, v_6 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_3, 3, fx_result), _fx_catch_2);
            }
         }

      _fx_catch_2: ;
         FX_FREE_STR(&v_6);
         FX_FREE_STR(&v_5);
         FX_FREE_STR(&v_4);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 2) {
      fx_str_t v_8 = {0};
      fx_str_t v_9 = {0};
      _fx_T2il* vcase_2 = &lit_0->u.KLitSInt;
      int64_t v_10 = vcase_2->t1;
      if (cmode_0) {
         FX_CALL(_fx_F6stringS1l(v_10, fx_result, 0), _fx_catch_3);
      }
      else {
         FX_CALL(_fx_F6stringS1l(v_10, &v_8, 0), _fx_catch_3);
         FX_CALL(_fx_F6stringS1i(vcase_2->t0, &v_9, 0), _fx_catch_3);
         fx_str_t slit_4 = FX_MAKE_STR("i");
         {
            const fx_str_t strs_4[] = { v_8, slit_4, v_9 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_4, 3, fx_result), _fx_catch_3);
         }
      }

   _fx_catch_3: ;
      FX_FREE_STR(&v_9);
      FX_FREE_STR(&v_8);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 3) {
      fx_str_t v_11 = {0};
      fx_str_t v_12 = {0};
      fx_str_t v_13 = {0};
      _fx_T2iq* vcase_3 = &lit_0->u.KLitUInt;
      uint64_t v_14 = vcase_3->t1;
      if (cmode_0) {
         FX_CALL(_fx_F6stringS1q(v_14, &v_11, 0), _fx_catch_4);
         fx_str_t slit_5 = FX_MAKE_STR("u");
         {
            const fx_str_t strs_5[] = { v_11, slit_5 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_5, 2, fx_result), _fx_catch_4);
         }
      }
      else {
         FX_CALL(_fx_F6stringS1q(v_14, &v_12, 0), _fx_catch_4);
         FX_CALL(_fx_F6stringS1i(vcase_3->t0, &v_13, 0), _fx_catch_4);
         fx_str_t slit_6 = FX_MAKE_STR("u");
         {
            const fx_str_t strs_6[] = { v_12, slit_6, v_13 };
            FX_CALL(fx_strjoin(0, 0, 0, strs_6, 3, fx_result), _fx_catch_4);
         }
      }

   _fx_catch_4: ;
      FX_FREE_STR(&v_13);
      FX_FREE_STR(&v_12);
      FX_FREE_STR(&v_11);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 4) {
      _fx_T2id* vcase_4 = &lit_0->u.KLitFloat;
      if (vcase_4->t0 == 16) {
         fx_str_t v_15 = {0};
         fx_str_t vstr_0 = {0};
         double v_16 = vcase_4->t1;
         if (!cmode_0) {
            FX_CALL(_fx_F6stringS1d(v_16, &v_15, 0), _fx_catch_5);
            fx_str_t slit_7 = FX_MAKE_STR("h");
            {
               const fx_str_t strs_7[] = { v_15, slit_7 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_7, 2, fx_result), _fx_catch_5);
            }
         }
         else {
            FX_CALL(_fx_F6stringS1d(v_16, &vstr_0, 0), _fx_catch_5);
            FX_STR_CHKIDX(vstr_0, 0, _fx_catch_5);
            bool v_17 = _fx_M4CharFM7isdigitB1C(FX_STR_ELEM(vstr_0, 0), 0);
            if (v_17) {
               fx_str_t slit_8 = FX_MAKE_STR("f");
               {
                  const fx_str_t strs_8[] = { vstr_0, slit_8 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_8, 2, fx_result), _fx_catch_5);
               }
            }
            else {
               int_ v_18;
               fx_str_t slit_9 = FX_MAKE_STR("inf");
               v_18 = _fx_M6StringFM4findi3SSi(&vstr_0, &slit_9, 0, 0);
               bool v_19;
               if (v_18 >= 0) {
                  v_19 = true;
               }
               else {
                  int_ v_20;
                  fx_str_t slit_10 = FX_MAKE_STR("INF");
                  v_20 = _fx_M6StringFM4findi3SSi(&vstr_0, &slit_10, 0, 0);
                  v_19 = v_20 >= 0;
               }
               if (v_19) {
                  FX_STR_CHKIDX(vstr_0, 0, _fx_catch_5);
                  if (FX_STR_ELEM(vstr_0, 0) == (char_)45) {
                     fx_str_t slit_11 = FX_MAKE_STR("-INFINITY"); fx_copy_str(&slit_11, fx_result);
                  }
                  else {
                     fx_str_t slit_12 = FX_MAKE_STR("INFINITY"); fx_copy_str(&slit_12, fx_result);
                  }
               }
               else {
                  int_ v_21;
                  fx_str_t slit_13 = FX_MAKE_STR("nan");
                  v_21 = _fx_M6StringFM4findi3SSi(&vstr_0, &slit_13, 0, 0);
                  bool v_22;
                  if (v_21 >= 0) {
                     v_22 = true;
                  }
                  else {
                     int_ v_23;
                     fx_str_t slit_14 = FX_MAKE_STR("NAN");
                     v_23 = _fx_M6StringFM4findi3SSi(&vstr_0, &slit_14, 0, 0);
                     v_22 = v_23 >= 0;
                  }
                  if (v_22) {
                     fx_str_t slit_15 = FX_MAKE_STR("NAN"); fx_copy_str(&slit_15, fx_result);
                  }
                  else {
                     fx_str_t slit_16 = FX_MAKE_STR("f");
                     {
                        const fx_str_t strs_9[] = { vstr_0, slit_16 };
                        FX_CALL(fx_strjoin(0, 0, 0, strs_9, 2, fx_result), _fx_catch_5);
                     }
                  }
               }
            }
         }

      _fx_catch_5: ;
         FX_FREE_STR(&vstr_0);
         FX_FREE_STR(&v_15);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 4) {
      _fx_T2id* vcase_5 = &lit_0->u.KLitFloat;
      if (vcase_5->t0 == 32) {
         fx_str_t v_24 = {0};
         fx_str_t vstr_1 = {0};
         double v_25 = vcase_5->t1;
         if (!cmode_0) {
            FX_CALL(_fx_F6stringS1d(v_25, &v_24, 0), _fx_catch_6);
            fx_str_t slit_17 = FX_MAKE_STR("f");
            {
               const fx_str_t strs_10[] = { v_24, slit_17 };
               FX_CALL(fx_strjoin(0, 0, 0, strs_10, 2, fx_result), _fx_catch_6);
            }
         }
         else {
            FX_CALL(_fx_F6stringS1d(v_25, &vstr_1, 0), _fx_catch_6);
            FX_STR_CHKIDX(vstr_1, 0, _fx_catch_6);
            bool v_26 = _fx_M4CharFM7isdigitB1C(FX_STR_ELEM(vstr_1, 0), 0);
            if (v_26) {
               fx_str_t slit_18 = FX_MAKE_STR("f");
               {
                  const fx_str_t strs_11[] = { vstr_1, slit_18 };
                  FX_CALL(fx_strjoin(0, 0, 0, strs_11, 2, fx_result), _fx_catch_6);
               }
            }
            else {
               int_ v_27;
               fx_str_t slit_19 = FX_MAKE_STR("inf");
               v_27 = _fx_M6StringFM4findi3SSi(&vstr_1, &slit_19, 0, 0);
               bool v_28;
               if (v_27 >= 0) {
                  v_28 = true;
               }
               else {
                  int_ v_29;
                  fx_str_t slit_20 = FX_MAKE_STR("INF");
                  v_29 = _fx_M6StringFM4findi3SSi(&vstr_1, &slit_20, 0, 0);
                  v_28 = v_29 >= 0;
               }
               if (v_28) {
                  FX_STR_CHKIDX(vstr_1, 0, _fx_catch_6);
                  if (FX_STR_ELEM(vstr_1, 0) == (char_)45) {
                     fx_str_t slit_21 = FX_MAKE_STR("-INFINITY"); fx_copy_str(&slit_21, fx_result);
                  }
                  else {
                     fx_str_t slit_22 = FX_MAKE_STR("INFINITY"); fx_copy_str(&slit_22, fx_result);
                  }
               }
               else {
                  int_ v_30;
                  fx_str_t slit_23 = FX_MAKE_STR("nan");
                  v_30 = _fx_M6StringFM4findi3SSi(&vstr_1, &slit_23, 0, 0);
                  bool v_31;
                  if (v_30 >= 0) {
                     v_31 = true;
                  }
                  else {
                     int_ v_32;
                     fx_str_t slit_24 = FX_MAKE_STR("NAN");
                     v_32 = _fx_M6StringFM4findi3SSi(&vstr_1, &slit_24, 0, 0);
                     v_31 = v_32 >= 0;
                  }
                  if (v_31) {
                     fx_str_t slit_25 = FX_MAKE_STR("NAN"); fx_copy_str(&slit_25, fx_result);
                  }
                  else {
                     fx_str_t slit_26 = FX_MAKE_STR("f");
                     {
                        const fx_str_t strs_12[] = { vstr_1, slit_26 };
                        FX_CALL(fx_strjoin(0, 0, 0, strs_12, 2, fx_result), _fx_catch_6);
                     }
                  }
               }
            }
         }

      _fx_catch_6: ;
         FX_FREE_STR(&vstr_1);
         FX_FREE_STR(&v_24);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 4) {
      _fx_T2id* vcase_6 = &lit_0->u.KLitFloat;
      if (vcase_6->t0 == 64) {
         fx_str_t vstr_2 = {0};
         double v_33 = vcase_6->t1;
         if (!cmode_0) {
            FX_CALL(_fx_F6stringS1d(v_33, fx_result, 0), _fx_catch_7);
         }
         else {
            FX_CALL(_fx_F6stringS1d(v_33, &vstr_2, 0), _fx_catch_7);
            FX_STR_CHKIDX(vstr_2, 0, _fx_catch_7);
            bool v_34 = _fx_M4CharFM7isdigitB1C(FX_STR_ELEM(vstr_2, 0), 0);
            if (v_34) {
               fx_copy_str(&vstr_2, fx_result);
            }
            else {
               int_ v_35;
               fx_str_t slit_27 = FX_MAKE_STR("inf");
               v_35 = _fx_M6StringFM4findi3SSi(&vstr_2, &slit_27, 0, 0);
               bool v_36;
               if (v_35 >= 0) {
                  v_36 = true;
               }
               else {
                  int_ v_37;
                  fx_str_t slit_28 = FX_MAKE_STR("INF");
                  v_37 = _fx_M6StringFM4findi3SSi(&vstr_2, &slit_28, 0, 0);
                  v_36 = v_37 >= 0;
               }
               if (v_36) {
                  FX_STR_CHKIDX(vstr_2, 0, _fx_catch_7);
                  if (FX_STR_ELEM(vstr_2, 0) == (char_)45) {
                     fx_str_t slit_29 = FX_MAKE_STR("-INFINITY"); fx_copy_str(&slit_29, fx_result);
                  }
                  else {
                     fx_str_t slit_30 = FX_MAKE_STR("INFINITY"); fx_copy_str(&slit_30, fx_result);
                  }
               }
               else {
                  int_ v_38;
                  fx_str_t slit_31 = FX_MAKE_STR("nan");
                  v_38 = _fx_M6StringFM4findi3SSi(&vstr_2, &slit_31, 0, 0);
                  bool v_39;
                  if (v_38 >= 0) {
                     v_39 = true;
                  }
                  else {
                     int_ v_40;
                     fx_str_t slit_32 = FX_MAKE_STR("NAN");
                     v_40 = _fx_M6StringFM4findi3SSi(&vstr_2, &slit_32, 0, 0);
                     v_39 = v_40 >= 0;
                  }
                  if (v_39) {
                     fx_str_t slit_33 = FX_MAKE_STR("NAN"); fx_copy_str(&slit_33, fx_result);
                  }
                  else {
                     fx_copy_str(&vstr_2, fx_result);
                  }
               }
            }
         }

      _fx_catch_7: ;
         FX_FREE_STR(&vstr_2);
         goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 4) {
      fx_str_t v_41 = {0};
      fx_str_t v_42 = {0};
      fx_str_t v_43 = {0};
      fx_exn_t v_44 = {0};
      _fx_T2id* vcase_7 = &lit_0->u.KLitFloat;
      FX_CALL(_fx_F6stringS1i(vcase_7->t0, &v_41, 0), _fx_catch_8);
      FX_CALL(_fx_F6stringS1d(vcase_7->t1, &v_42, 0), _fx_catch_8);
      fx_str_t slit_34 = FX_MAKE_STR("invalid literal LitFloat(");
      fx_str_t slit_35 = FX_MAKE_STR(", ");
      fx_str_t slit_36 = FX_MAKE_STR(")");
      {
         const fx_str_t strs_13[] = { slit_34, v_41, slit_35, v_42, slit_36 };
         FX_CALL(fx_strjoin(0, 0, 0, strs_13, 5, &v_43), _fx_catch_8);
      }
      FX_CALL(_fx_M3AstFM11compile_errE2RM5loc_tS(loc_0, &v_43, &v_44, 0), _fx_catch_8);
      FX_THROW(&v_44, false, _fx_catch_8);

   _fx_catch_8: ;
      fx_free_exn(&v_44);
      FX_FREE_STR(&v_43);
      FX_FREE_STR(&v_42);
      FX_FREE_STR(&v_41);
      goto _fx_endmatch_0;
   }
   if (tag_0 == 5) {
      FX_CALL(_fx_M6StringFM7escapedS2SB(&lit_0->u.KLitString, true, fx_result, 0), _fx_catch_9);

   _fx_catch_9: ;
      goto _fx_endmatch_0;
   }
   if (tag_0 == 6) {
      FX_CALL(_fx_F4reprS1C(lit_0->u.KLitChar, fx_result, 0), _fx_catch_10);  _fx_catch_10: ; goto _fx_endmatch_0;
   }
   if (tag_0 == 7) {
      if (lit_0->u.KLitBool == true) {
         fx_str_t slit_37 = FX_MAKE_STR("true"); fx_copy_str(&slit_37, fx_result); goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 7) {
      if (lit_0->u.KLitBool == false) {
         fx_str_t slit_38 = FX_MAKE_STR("false"); fx_copy_str(&slit_38, fx_result); goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 8) {
      fx_str_t slit_39 = FX_MAKE_STR("null"); fx_copy_str(&slit_39, fx_result); goto _fx_endmatch_0;
   }
   if (tag_0 == 8) {
      if (FX_REC_VARIANT_TAG(lit_0->u.KLitNil) == 12) {
         fx_str_t slit_40 = FX_MAKE_STR("null"); fx_copy_str(&slit_40, fx_result); goto _fx_endmatch_0;
      }
   }
   if (tag_0 == 8) {
      fx_str_t slit_41 = FX_MAKE_STR("[]"); fx_copy_str(&slit_41, fx_result); goto _fx_endmatch_0;
   }
   FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);

_fx_endmatch_0: ;

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM7ktl2strS1LN14K_form__ktyp_t(
   struct _fx_LN14K_form__ktyp_t_data_t* tl_0,
   fx_str_t* fx_result,
   void* fx_fv)
{
   _fx_Ta2S v_0 = {0};
   fx_str_t begin_0 = {0};
   fx_str_t end_0 = {0};
   fx_arr_t v_1 = {0};
   int fx_status = 0;
   FX_CALL(fx_check_stack(), _fx_cleanup);
   if (tl_0 != 0) {
      if (tl_0->tl == 0) {
         fx_str_t slit_0 = FX_MAKE_STR("");
         fx_str_t slit_1 = FX_MAKE_STR("");
         _fx_make_Ta2S(&slit_0, &slit_1, &v_0);
         goto _fx_endmatch_0;
      }
   }
   fx_str_t slit_2 = FX_MAKE_STR("(");
   fx_str_t slit_3 = FX_MAKE_STR(")");
   _fx_make_Ta2S(&slit_2, &slit_3, &v_0);

_fx_endmatch_0: ;
   FX_CHECK_EXN(_fx_cleanup);
   fx_copy_str(&v_0.t0, &begin_0);
   fx_copy_str(&v_0.t1, &end_0);
   fx_str_t* dstptr_0 = 0;
   _fx_LN14K_form__ktyp_t lst_0 = tl_0;
   int_ len_0 = fx_list_length(lst_0);
   {
      const int_ shape_0[] = { len_0 };
      FX_CALL(fx_make_arr(1, shape_0, sizeof(fx_str_t), (fx_free_t)fx_free_str, (fx_copy_t)fx_copy_str, 0, &v_1), _fx_cleanup);
   }
   dstptr_0 = (fx_str_t*)v_1.data;
   for (; lst_0; lst_0 = lst_0->tl, dstptr_0++) {
      fx_str_t res_0 = {0};
      _fx_N14K_form__ktyp_t t_0 = lst_0->hd;
      FX_CALL(_fx_M6K_formFM6stringS1N14K_form__ktyp_t(t_0, &res_0, 0), _fx_catch_0);
      fx_copy_str(&res_0, dstptr_0);

   _fx_catch_0: ;
      FX_FREE_STR(&res_0);
      FX_CHECK_EXN(_fx_cleanup);
   }
   fx_str_t slit_4 = FX_MAKE_STR(", ");
   FX_CALL(_fx_F12join_embraceS4SSSA1S(&begin_0, &end_0, &slit_4, &v_1, fx_result, 0), _fx_cleanup);

_fx_cleanup: ;
   _fx_free_Ta2S(&v_0);
   FX_FREE_STR(&begin_0);
   FX_FREE_STR(&end_0);
   FX_FREE_ARR(&v_1);
   return fx_status;
}

FX_EXTERN_C int _fx_M6K_formFM8atom2strS1N14K_form__atom_t(struct _fx_N14K_form__atom_t* a_0, fx_str_t* fx_result, void* fx_fv)
{
   int fx_status = 0;
   int tag_0 = a_0->tag;
   if (tag_0 == 1) {
      FX_CALL(_fx_M6K_formFM7idk2strS2R9Ast__id_tR10Ast__loc_t(&a_0->u.AtomId, &_fx_g10Ast__noloc, fx_result, 0), _fx_catch_0);

   _fx_catch_0: ;
   }
   else if (tag_0 == 2) {
      FX_CALL(
         _fx_M6K_formFM8klit2strS3N14K_form__klit_tBR10Ast__loc_t(&a_0->u.AtomLit, false, &_fx_g10Ast__noloc, fx_result, 0),
         _fx_catch_1);

   _fx_catch_1: ;
   }
   else {
      FX_FAST_THROW(FX_EXN_NoMatchError, _fx_cleanup);
   }

_fx_cleanup: ;
   return fx_status;
}

FX_EXTERN_C int fx_init_K_form(void)
{
   fx_arr_t z_0 = {0};
   int fx_status = 0;
   _fx_M6K_formFM7KLitNilN14K_form__klit_t1N14K_form__ktyp_t(_fx_g16K_form__KTypVoid, &_fx_g17K_form___KLitVoid);
   _fx_M6K_formFM7AtomLitN14K_form__atom_t1N14K_form__klit_t(&_fx_g17K_form___KLitVoid, &_fx_g17K_form___ALitVoid);
   fx_copy_arr(&z_0, &_fx_g16K_form__all_idks);
   _fx_g32K_form__builtin_exn_NoMatchError = _fx_g9Ast__noid;
   _fx_g35K_form__builtin_exn_OutOfRangeError = _fx_g9Ast__noid;
   FX_FREE_ARR(&z_0);
   return fx_status;
}

FX_EXTERN_C void fx_deinit_K_form(void)
{
   _fx_free_N14K_form__klit_t(&_fx_g17K_form___KLitVoid);
   _fx_free_N14K_form__atom_t(&_fx_g17K_form___ALitVoid);
   FX_FREE_ARR(&_fx_g16K_form__all_idks);
}

